Improve CI

This commit is contained in:
syuilo 2021-10-28 01:16:13 +09:00
parent 21ece52a9f
commit d35b02fa23
3 changed files with 60 additions and 10 deletions

21
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Lint
on:
push:
branches:
- master
- develop
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-node@v1
with:
node-version: 12.x
- run: yarn install
- run: yarn lint

View File

@ -1,4 +1,5 @@
name: Node.js CI name: Test
on: on:
push: push:
branches: branches:
@ -7,12 +8,12 @@ on:
pull_request: pull_request:
jobs: jobs:
build_and_test: mocha:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
node-version: [14.x, 16.x] node-version: [16.x]
services: services:
postgres: postgres:
@ -44,16 +45,43 @@ jobs:
- name: Build - name: Build
run: yarn build run: yarn build
- name: Test - name: Test
run: yarn test run: yarn mocha
lint: e2e:
runs-on: ubuntu-latest runs-on: ubuntu-latest
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
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: true submodules: true
- uses: actions/setup-node@v1 - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with: with:
node-version: 12.x node-version: ${{ matrix.node-version }}
- run: yarn install - name: Install dependencies
- run: yarn lint run: yarn install
- name: Check yarn.lock
run: git diff --exit-code yarn.lock
- name: Copy Configure
run: cp test/test.yml .config
- name: Build
run: yarn build
- name: Test
run: yarn e2e

View File

@ -29,7 +29,8 @@
"cy:open": "cypress open", "cy:open": "cypress open",
"cy:run": "cypress run", "cy:run": "cypress run",
"e2e": "start-server-and-test start:test http://localhost cy:run", "e2e": "start-server-and-test start:test http://localhost cy:run",
"test": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha",
"test": "npm run mocha",
"format": "gulp format" "format": "gulp format"
}, },
"resolutions": { "resolutions": {