chore: test min version

This commit is contained in:
zyoshoka 2025-05-01 21:09:24 +09:00
parent b9f39311e6
commit a16873ab76
No known key found for this signature in database
6 changed files with 26 additions and 9 deletions

1
.github/min.node-version vendored Normal file
View File

@ -0,0 +1 @@
20.10.0

View File

@ -22,6 +22,11 @@ jobs:
unit:
name: Unit tests (backend)
runs-on: ubuntu-latest
strategy:
matrix:
node-version-file:
- .node-version
- .github/min.node-version
services:
postgres:
@ -60,7 +65,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4.4.0
with:
node-version-file: '.node-version'
node-version-file: ${{ matrix.node-version-file }}
cache: 'pnpm'
- run: pnpm i --frozen-lockfile
- name: Check pnpm-lock.yaml
@ -80,6 +85,11 @@ jobs:
e2e:
name: E2E tests (backend)
runs-on: ubuntu-latest
strategy:
matrix:
node-version-file:
- .node-version
- .github/min.node-version
services:
postgres:
@ -103,7 +113,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4.4.0
with:
node-version-file: '.node-version'
node-version-file: ${{ matrix.node-version-file }}
cache: 'pnpm'
- run: pnpm i --frozen-lockfile
- name: Check pnpm-lock.yaml

View File

@ -19,6 +19,11 @@ jobs:
test:
name: Federation test
runs-on: ubuntu-latest
strategy:
matrix:
node-version-file:
- .node-version
- .github/min.node-version
steps:
- uses: actions/checkout@v4
with:
@ -43,7 +48,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4.4.0
with:
node-version-file: '.node-version'
node-version-file: ${{ matrix.node-version-file }}
cache: 'pnpm'
- name: Build Misskey
run: |
@ -51,6 +56,7 @@ jobs:
pnpm build
- name: Setup
run: |
echo "NODE_VERSION=$(cat ${{ matrix.node-version-file }})" >> $GITHUB_ENV
cd packages/backend/test-federation
bash ./setup.sh
sudo chmod 644 ./certificates/*.test.key

View File

@ -10,15 +10,15 @@ cd packages/backend/test-federation
First, you need to start servers by executing following commands:
```sh
bash ./setup.sh
docker compose up --scale tester=0
NODE_VERSION=22 docker compose up --scale tester=0
```
Then you can run all tests by a following command:
```sh
docker compose run --no-deps --rm tester
NODE_VERSION=22 docker compose run --no-deps --rm tester
```
For testing a specific file, run a following command:
```sh
docker compose run --no-deps --rm tester -- pnpm -F backend test:fed packages/backend/test-federation/test/user.test.ts
NODE_VERSION=22 docker compose run --no-deps --rm tester -- pnpm -F backend test:fed packages/backend/test-federation/test/user.test.ts
```

View File

@ -12,7 +12,7 @@ services:
retries: 20
misskey:
image: node:20
image: node:${NODE_VERSION}
env_file:
- ./.config/docker.env
environment:

View File

@ -16,7 +16,7 @@ services:
"
tester:
image: node:20
image: node:${NODE_VERSION}
depends_on:
a.test:
condition: service_healthy
@ -85,7 +85,7 @@ services:
command: pnpm -F backend test:fed
daemon:
image: node:20
image: node:${NODE_VERSION}
depends_on:
redis.test:
condition: service_healthy