2021-10-27 10:16:13 -06:00
|
|
|
name: Test
|
|
|
|
|
2020-03-19 11:46:13 -06:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
pull_request:
|
2020-01-08 22:35:04 -07:00
|
|
|
|
|
|
|
jobs:
|
2021-10-27 10:16:13 -06:00
|
|
|
mocha:
|
2020-01-08 22:35:04 -07:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-04-28 19:17:03 -06:00
|
|
|
node-version: [18.x]
|
2020-03-19 11:46:13 -06:00
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
2022-01-21 00:43:56 -07:00
|
|
|
image: postgres:13
|
2020-03-19 11:46:13 -06:00
|
|
|
ports:
|
2021-10-16 02:12:20 -06:00
|
|
|
- 54312:5432
|
2020-03-19 11:46:13 -06:00
|
|
|
env:
|
|
|
|
POSTGRES_DB: test-misskey
|
|
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
2022-05-31 20:41:15 -06:00
|
|
|
YARN_CHECKSUM_BEHAVIOR: update
|
2020-03-19 11:46:13 -06:00
|
|
|
redis:
|
2022-01-21 00:43:56 -07:00
|
|
|
image: redis:6
|
2020-03-19 11:46:13 -06:00
|
|
|
ports:
|
2021-10-16 02:12:20 -06:00
|
|
|
- 56312:6379
|
2020-01-08 22:35:04 -07:00
|
|
|
|
|
|
|
steps:
|
2020-05-08 02:46:58 -06:00
|
|
|
- uses: actions/checkout@v2
|
2021-09-04 02:54:24 -06:00
|
|
|
with:
|
|
|
|
submodules: true
|
2020-01-08 22:35:04 -07:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2022-04-03 00:21:46 -06:00
|
|
|
uses: actions/setup-node@v3
|
2020-01-08 22:35:04 -07:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2022-05-29 21:26:38 -06:00
|
|
|
- run: corepack enable
|
2022-05-31 01:24:40 -06:00
|
|
|
- run: yarn set version berry
|
|
|
|
- run: yarn workspaces foreach install --immutable
|
2022-06-02 04:51:29 -06:00
|
|
|
continue-on-error: true
|
2021-08-16 01:33:45 -06:00
|
|
|
- name: Check yarn.lock
|
|
|
|
run: git diff --exit-code yarn.lock
|
2020-03-19 11:46:13 -06:00
|
|
|
- name: Copy Configure
|
2021-11-11 20:43:55 -07:00
|
|
|
run: cp .github/misskey/test.yml .config
|
2020-03-19 11:46:13 -06:00
|
|
|
- name: Build
|
|
|
|
run: yarn build
|
|
|
|
- name: Test
|
2021-10-27 10:16:13 -06:00
|
|
|
run: yarn mocha
|
2020-03-19 11:46:13 -06:00
|
|
|
|
2021-10-27 10:16:13 -06:00
|
|
|
e2e:
|
2020-03-19 11:46:13 -06:00
|
|
|
runs-on: ubuntu-latest
|
2021-10-27 10:16:13 -06:00
|
|
|
|
|
|
|
strategy:
|
2022-01-21 00:43:56 -07:00
|
|
|
fail-fast: false
|
2021-10-27 10:16:13 -06:00
|
|
|
matrix:
|
2022-04-28 19:17:03 -06:00
|
|
|
node-version: [18.x]
|
2022-01-21 00:43:56 -07:00
|
|
|
browser: [chrome]
|
2021-10-27 10:16:13 -06:00
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
2022-01-21 00:43:56 -07:00
|
|
|
image: postgres:13
|
2021-10-27 10:16:13 -06:00
|
|
|
ports:
|
|
|
|
- 54312:5432
|
|
|
|
env:
|
|
|
|
POSTGRES_DB: test-misskey
|
|
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
|
|
redis:
|
2022-01-21 00:43:56 -07:00
|
|
|
image: redis:6
|
2021-10-27 10:16:13 -06:00
|
|
|
ports:
|
|
|
|
- 56312:6379
|
|
|
|
|
2020-03-19 11:46:13 -06:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-09-04 02:54:24 -06:00
|
|
|
with:
|
|
|
|
submodules: true
|
2022-01-21 00:43:56 -07:00
|
|
|
# https://github.com/cypress-io/cypress-docker-images/issues/150
|
|
|
|
#- name: Install mplayer for FireFox
|
|
|
|
# run: sudo apt install mplayer -y
|
|
|
|
# if: ${{ matrix.browser == 'firefox' }}
|
|
|
|
#- uses: browser-actions/setup-firefox@latest
|
|
|
|
# if: ${{ matrix.browser == 'firefox' }}
|
2021-10-27 10:16:13 -06:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2022-04-03 00:21:46 -06:00
|
|
|
uses: actions/setup-node@v3
|
2020-03-19 11:46:13 -06:00
|
|
|
with:
|
2021-10-27 10:16:13 -06:00
|
|
|
node-version: ${{ matrix.node-version }}
|
2022-05-29 21:26:38 -06:00
|
|
|
- run: corepack enable
|
2022-05-31 01:24:40 -06:00
|
|
|
- run: yarn set version berry
|
|
|
|
- run: yarn workspaces foreach install --immutable
|
2022-05-31 09:38:27 -06:00
|
|
|
env:
|
|
|
|
YARN_CHECKSUM_BEHAVIOR: update
|
2021-10-27 10:16:13 -06:00
|
|
|
- name: Copy Configure
|
2021-11-11 20:43:55 -07:00
|
|
|
run: cp .github/misskey/test.yml .config
|
2021-10-27 10:16:13 -06:00
|
|
|
- name: Build
|
|
|
|
run: yarn build
|
2022-01-21 00:43:56 -07:00
|
|
|
# https://github.com/cypress-io/cypress/issues/4351#issuecomment-559489091
|
|
|
|
- name: ALSA Env
|
|
|
|
run: echo -e 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > ~/.asoundrc
|
|
|
|
- name: Cypress run
|
|
|
|
uses: cypress-io/github-action@v2
|
|
|
|
with:
|
|
|
|
install: false
|
|
|
|
start: npm run start:test
|
|
|
|
wait-on: 'http://localhost:61812'
|
|
|
|
headless: false
|
|
|
|
browser: ${{ matrix.browser }}
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.browser }}-cypress-screenshots
|
|
|
|
path: cypress/screenshots
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.browser }}-cypress-videos
|
|
|
|
path: cypress/videos
|