パーソナル(ユーザー)メモ機能を削除 (#364) #665
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test (backend) | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
- develop-mame | |
paths: | |
- packages/backend/** | |
- packages/misskey-js/** | |
- .github/workflows/test-backend.yml | |
- .node-version | |
pull_request: | |
paths: | |
- packages/backend/** | |
- packages/misskey-js/** | |
- .github/workflows/test-backend.yml | |
- .node-version | |
permissions: {} | |
env: | |
NUM_OF_E2E_SHARDS: 4 | |
jobs: | |
unit: | |
name: unit (backend) | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
services: | |
postgres: | |
image: postgres:15 | |
ports: | |
- 54312:5432 | |
env: | |
POSTGRES_DB: test-misskey | |
POSTGRES_HOST_AUTH_METHOD: trust | |
redis: | |
image: redis:7 | |
ports: | |
- 56312:6379 | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Setup FFmpeg | |
uses: FedericoCarboni/setup-ffmpeg@36c6454b5a2348e7794ba2d82a21506605921e3d | |
- name: Setup Node.js | |
uses: actions/[email protected] | |
with: | |
node-version-file: '.node-version' | |
cache: 'pnpm' | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Check if lock file is not modified | |
run: git diff --exit-code pnpm-lock.yaml | |
- name: Copy config file | |
run: cp .github/misskey/test.yml .config | |
- name: Pre-build and Build misskey-js | |
run: pnpm run build-pre && pnpm --filter misskey-js run build | |
- name: Test | |
run: pnpm --filter backend run test-and-coverage | |
- name: Upload coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./packages/backend/coverage/coverage-final.json | |
disable_search: true | |
flags: backend_unit | |
e2e: | |
name: e2e (backend) | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
shard: [1, 2, 3, 4] | |
services: | |
postgres: | |
image: postgres:15 | |
ports: | |
- 54312:5432 | |
env: | |
POSTGRES_DB: test-misskey | |
POSTGRES_HOST_AUTH_METHOD: trust | |
redis: | |
image: redis:7 | |
ports: | |
- 56312:6379 | |
steps: | |
- name: Check if matrix is configured properly | |
if: ${{ strategy.job-total != env.NUM_OF_E2E_SHARDS }} | |
run: 'false' | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Setup Node.js | |
uses: actions/[email protected] | |
with: | |
node-version-file: '.node-version' | |
cache: 'pnpm' | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Check if lock file is not modified | |
run: git diff --exit-code pnpm-lock.yaml | |
- name: Copy config file | |
run: cp .github/misskey/test.yml .config | |
- name: Pre-build and Build misskey-js | |
run: pnpm run build-pre && pnpm --filter misskey-js run build | |
- name: Test | |
run: pnpm --filter backend run test-and-coverage:e2e --shard=${{ matrix.shard }}/${{ strategy.job-total }} | |
- name: Upload coverage artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-e2e-${{ matrix.shard }} | |
path: packages/backend/coverage | |
merge_backend_e2e_coverage: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
needs: e2e | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: coverage-e2e-* | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Count artifacts | |
id: count-artifacts | |
run: echo "count=$(find . -mindepth 1 -maxdepth 1 -type d -name 'coverage-e2e-*' | wc -l)" >> $GITHUB_OUTPUT | |
- name: Check if artifacts count is correct | |
if: ${{ steps.count-artifacts.outputs.count != env.NUM_OF_E2E_SHARDS }} | |
run: 'false' | |
- name: Merge coverage reports | |
run: | | |
mkdir packages/backend/coverage | |
npx istanbul-merge --out packages/backend/coverage/coverage-merged.json $(find . -mindepth 1 -maxdepth 1 -type d -name 'coverage-e2e-*' | awk '{ printf "%s/coverage-final.json ", $0 }') | |
- name: Upload coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./packages/backend/coverage/coverage-merged.json | |
disable_search: true | |
flags: backend_e2e | |
federation: | |
name: test (federation) | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Setup FFmpeg | |
uses: FedericoCarboni/setup-ffmpeg@36c6454b5a2348e7794ba2d82a21506605921e3d | |
- name: Setup Node.js | |
uses: actions/[email protected] | |
with: | |
node-version-file: '.node-version' | |
cache: 'pnpm' | |
- name: Enable Corepack | |
run: corepack enable && corepack prepare | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Check if lock file is not modified | |
run: git diff --exit-code pnpm-lock.yaml | |
- name: Build | |
run: pnpm run build | |
- name: Setup test | |
run: | | |
cd packages/backend/test-federation | |
bash ./setup.sh | |
sudo chmod 644 ./certificates/*.test.key | |
- name: Start servers | |
# https://github.com/docker/compose/issues/1294#issuecomment-374847206 | |
run: | | |
cd packages/backend/test-federation | |
docker compose up -d --scale tester=0 | |
- name: Test | |
run: | | |
cd packages/backend/test-federation | |
docker compose run --no-deps tester | |
- name: Stop servers | |
run: | | |
cd packages/backend/test-federation | |
docker compose down |