2020-01-09 14:35:04 +09:00
|
|
|
name: Node.js CI
|
2020-03-20 02:46:13 +09:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
pull_request:
|
2020-01-09 14:35:04 +09:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_and_test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-04-28 09:22:01 +09:00
|
|
|
node-version: [14.x, 16.x]
|
2020-03-20 02:46:13 +09:00
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
2021-10-16 17:12:20 +09:00
|
|
|
image: postgres:12.2-alpine
|
2020-03-20 02:46:13 +09:00
|
|
|
ports:
|
2021-10-16 17:12:20 +09:00
|
|
|
- 54312:5432
|
2020-03-20 02:46:13 +09:00
|
|
|
env:
|
|
|
|
POSTGRES_DB: test-misskey
|
|
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
|
|
redis:
|
2021-10-16 17:12:20 +09:00
|
|
|
image: redis:4.0-alpine
|
2020-03-20 02:46:13 +09:00
|
|
|
ports:
|
2021-10-16 17:12:20 +09:00
|
|
|
- 56312:6379
|
2020-01-09 14:35:04 +09:00
|
|
|
|
|
|
|
steps:
|
2020-05-08 17:46:58 +09:00
|
|
|
- uses: actions/checkout@v2
|
2021-09-04 17:54:24 +09:00
|
|
|
with:
|
|
|
|
submodules: true
|
2020-01-09 14:35:04 +09:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2020-03-20 02:46:13 +09:00
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install
|
2021-08-16 16:33:45 +09:00
|
|
|
- name: Check yarn.lock
|
|
|
|
run: git diff --exit-code yarn.lock
|
2020-03-20 02:46:13 +09:00
|
|
|
- name: Copy Configure
|
2021-10-16 17:12:20 +09:00
|
|
|
run: cp test/test.yml .config
|
2020-03-20 02:46:13 +09:00
|
|
|
- name: Build
|
|
|
|
run: yarn build
|
|
|
|
- name: Test
|
|
|
|
run: yarn test
|
|
|
|
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-09-04 17:54:24 +09:00
|
|
|
with:
|
|
|
|
submodules: true
|
2020-03-20 02:46:13 +09:00
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
2020-03-04 11:45:33 +09:00
|
|
|
- run: yarn install
|
2020-03-20 02:46:13 +09:00
|
|
|
- run: yarn lint
|