forked from misskey-dev/misskey
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/develop' into refactor-fronten…
…d-types
- Loading branch information
Showing
92 changed files
with
2,873 additions
and
1,261 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,18 @@ on: | |
branches: | ||
- master | ||
- develop | ||
paths: | ||
- packages/backend/** | ||
# for permissions | ||
- packages/misskey-js/** | ||
pull_request: | ||
paths: | ||
- packages/backend/** | ||
# for permissions | ||
- packages/misskey-js/** | ||
|
||
jobs: | ||
jest: | ||
unit: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
|
@@ -51,9 +59,59 @@ jobs: | |
- name: Build | ||
run: pnpm build | ||
- name: Test | ||
run: pnpm jest-and-coverage | ||
- name: Upload Coverage | ||
run: pnpm --filter backend test-and-coverage | ||
- name: Upload to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./packages/backend/coverage/coverage-final.json | ||
|
||
e2e: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.10.0] | ||
|
||
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: | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: true | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: false | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
- run: corepack enable | ||
- run: pnpm i --frozen-lockfile | ||
- name: Check pnpm-lock.yaml | ||
run: git diff --exit-code pnpm-lock.yaml | ||
- name: Copy Configure | ||
run: cp .github/misskey/test.yml .config | ||
- name: Build | ||
run: pnpm build | ||
- name: Test | ||
run: pnpm --filter backend test-and-coverage:e2e | ||
- name: Upload to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./packages/backend/coverage/coverage-final.json |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Test (backend) | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
paths: | ||
- packages/backend/** | ||
pull_request: | ||
paths: | ||
- packages/backend/** | ||
|
||
jobs: | ||
validate-api-json: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.10.0] | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: true | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: false | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
- name: Install swagger-cli | ||
run: npm i -g swagger-cli | ||
- run: corepack enable | ||
- run: pnpm i --frozen-lockfile | ||
- name: Check pnpm-lock.yaml | ||
run: git diff --exit-code pnpm-lock.yaml | ||
- name: Copy Configure | ||
run: cp .config/example.yml .config/default.yml | ||
- name: Build and generate | ||
run: pnpm build && pnpm --filter backend generate-api-json | ||
- name: Validation | ||
run: swagger-cli validate ./packages/backend/built/api.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ docker-compose.yml | |
# misskey | ||
/build | ||
built | ||
built-test | ||
/data | ||
/.cache-loader | ||
/db | ||
|
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* For a detailed explanation regarding each configuration property and type check, visit: | ||
* https://jestjs.io/docs/en/configuration.html | ||
*/ | ||
|
||
const base = require('./jest.config.cjs') | ||
|
||
module.exports = { | ||
...base, | ||
globalSetup: "<rootDir>/built-test/entry.js", | ||
setupFilesAfterEnv: ["<rootDir>/test/jest.setup.ts"], | ||
testMatch: [ | ||
"<rootDir>/test/e2e/**/*.ts", | ||
], | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* For a detailed explanation regarding each configuration property and type check, visit: | ||
* https://jestjs.io/docs/en/configuration.html | ||
*/ | ||
|
||
const base = require('./jest.config.cjs') | ||
|
||
module.exports = { | ||
...base, | ||
testMatch: [ | ||
"<rootDir>/test/unit/**/*.ts", | ||
"<rootDir>/src/**/*.test.ts", | ||
], | ||
}; |
24 changes: 24 additions & 0 deletions
24
packages/backend/migration/1704959805077-bubble-game-record.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and other misskey contributors | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
export class BubbleGameRecord1704959805077 { | ||
name = 'BubbleGameRecord1704959805077' | ||
|
||
async up(queryRunner) { | ||
await queryRunner.query(`CREATE TABLE "bubble_game_record" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "seededAt" TIMESTAMP WITH TIME ZONE NOT NULL, "seed" character varying(1024) NOT NULL, "gameVersion" integer NOT NULL, "gameMode" character varying(128) NOT NULL, "score" integer NOT NULL, "logs" jsonb NOT NULL DEFAULT '[]', "isVerified" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_a75395fe404b392e2893b50d7ea" PRIMARY KEY ("id"))`); | ||
await queryRunner.query(`CREATE INDEX "IDX_75276757070d21fdfaf4c05290" ON "bubble_game_record" ("userId") `); | ||
await queryRunner.query(`CREATE INDEX "IDX_4ae7053179014915d1432d3f40" ON "bubble_game_record" ("seededAt") `); | ||
await queryRunner.query(`CREATE INDEX "IDX_26d4ee490b5a487142d35466ee" ON "bubble_game_record" ("score") `); | ||
await queryRunner.query(`ALTER TABLE "bubble_game_record" ADD CONSTRAINT "FK_75276757070d21fdfaf4c052909" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); | ||
} | ||
|
||
async down(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "bubble_game_record" DROP CONSTRAINT "FK_75276757070d21fdfaf4c052909"`); | ||
await queryRunner.query(`DROP INDEX "public"."IDX_26d4ee490b5a487142d35466ee"`); | ||
await queryRunner.query(`DROP INDEX "public"."IDX_4ae7053179014915d1432d3f40"`); | ||
await queryRunner.query(`DROP INDEX "public"."IDX_75276757070d21fdfaf4c05290"`); | ||
await queryRunner.query(`DROP TABLE "bubble_game_record"`); | ||
} | ||
} |
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
Oops, something went wrong.