2021-10-27 11:16:13 -05:00
|
|
|
name: Test
|
|
|
|
|
2020-03-19 12:46:13 -05:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
pull_request:
|
2020-01-08 23:35:04 -06:00
|
|
|
|
|
|
|
jobs:
|
2021-10-27 11:16:13 -05:00
|
|
|
mocha:
|
2020-01-08 23:35:04 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-10-27 11:16:13 -05:00
|
|
|
node-version: [16.x]
|
2020-03-19 12:46:13 -05:00
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
2021-10-16 03:12:20 -05:00
|
|
|
image: postgres:12.2-alpine
|
2020-03-19 12:46:13 -05:00
|
|
|
ports:
|
2021-10-16 03:12:20 -05:00
|
|
|
- 54312:5432
|
2020-03-19 12:46:13 -05:00
|
|
|
env:
|
|
|
|
POSTGRES_DB: test-misskey
|
|
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
|
|
redis:
|
2021-10-16 03:12:20 -05:00
|
|
|
image: redis:4.0-alpine
|
2020-03-19 12:46:13 -05:00
|
|
|
ports:
|
2021-10-16 03:12:20 -05:00
|
|
|
- 56312:6379
|
2020-01-08 23:35:04 -06:00
|
|
|
|
|
|
|
steps:
|
2020-05-08 03:46:58 -05:00
|
|
|
- uses: actions/checkout@v2
|
2021-09-04 03:54:24 -05:00
|
|
|
with:
|
|
|
|
submodules: true
|
2020-01-08 23:35:04 -06:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2020-03-19 12:46:13 -05:00
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install
|
2021-08-16 02:33:45 -05:00
|
|
|
- name: Check yarn.lock
|
|
|
|
run: git diff --exit-code yarn.lock
|
2020-03-19 12:46:13 -05:00
|
|
|
- name: Copy Configure
|
2021-11-11 21:43:55 -06:00
|
|
|
run: cp .github/misskey/test.yml .config
|
2020-03-19 12:46:13 -05:00
|
|
|
- name: Build
|
|
|
|
run: yarn build
|
|
|
|
- name: Test
|
2021-10-27 11:16:13 -05:00
|
|
|
run: yarn mocha
|
2020-03-19 12:46:13 -05:00
|
|
|
|
2021-10-27 11:16:13 -05:00
|
|
|
e2e:
|
2020-03-19 12:46:13 -05:00
|
|
|
runs-on: ubuntu-latest
|
2021-10-27 11:16:13 -05:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [16.x]
|
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:12.2-alpine
|
|
|
|
ports:
|
|
|
|
- 54312:5432
|
|
|
|
env:
|
|
|
|
POSTGRES_DB: test-misskey
|
|
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
|
|
redis:
|
|
|
|
image: redis:4.0-alpine
|
|
|
|
ports:
|
|
|
|
- 56312:6379
|
|
|
|
|
2020-03-19 12:46:13 -05:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-09-04 03:54:24 -05:00
|
|
|
with:
|
|
|
|
submodules: true
|
2021-10-27 11:16:13 -05:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
2020-03-19 12:46:13 -05:00
|
|
|
with:
|
2021-10-27 11:16:13 -05:00
|
|
|
node-version: ${{ matrix.node-version }}
|
2021-11-18 02:41:19 -06:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: '**/node_modules'
|
|
|
|
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
2021-10-27 11:16:13 -05:00
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install
|
|
|
|
- name: Check yarn.lock
|
|
|
|
run: git diff --exit-code yarn.lock
|
|
|
|
- name: Copy Configure
|
2021-11-11 21:43:55 -06:00
|
|
|
run: cp .github/misskey/test.yml .config
|
2021-10-27 11:16:13 -05:00
|
|
|
- name: Build
|
|
|
|
run: yarn build
|
|
|
|
- name: Test
|
|
|
|
run: yarn e2e
|