forked from misskey-dev/misskey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use generate-api-json to get api.json changes
- Loading branch information
Showing
1 changed file
with
8 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,21 +17,6 @@ jobs: | |
matrix: | ||
node-version: [20.5.1] | ||
|
||
services: | ||
db: | ||
image: postgres:13 | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_DB: misskey | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
POSTGRES_USER: example-misskey-user | ||
POSTGRESS_PASS: example-misskey-pass | ||
redis: | ||
image: redis:7 | ||
ports: | ||
- 6379:6379 | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -52,43 +37,17 @@ jobs: | |
- 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 | ||
run: pnpm build | ||
- name : Migrate | ||
run: pnpm migrate | ||
- name: Launch misskey | ||
run: | | ||
screen -S misskey -dm pnpm run dev | ||
sleep 30s | ||
- name: Wait for Misskey to be ready | ||
run: | | ||
MAX_RETRIES=12 | ||
RETRY_DELAY=5 | ||
count=0 | ||
until $(curl --output /dev/null --silent --head --fail http://localhost:3000) || [[ $count -eq $MAX_RETRIES ]]; do | ||
printf '.' | ||
sleep $RETRY_DELAY | ||
count=$((count + 1)) | ||
done | ||
if [[ $count -eq $MAX_RETRIES ]]; then | ||
echo "Failed to connect to Misskey after $MAX_RETRIES attempts." | ||
exit 1 | ||
fi | ||
- id: fetch | ||
name: Get api.json from Misskey | ||
run: | | ||
RESULT=$(curl --retry 5 --retry-delay 5 --retry-max-time 60 http://localhost:3000/api.json) | ||
echo $RESULT > api-base.json | ||
- name: Generate API JSON | ||
run: pnpm --filter backend generate-api-json | ||
- name: Copy API.json | ||
run: cp packages/backend/built/api.json api-base.json | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: api-artifact | ||
path: api-base.json | ||
- name: Kill Misskey Job | ||
run: screen -S misskey -X quit | ||
|
||
get-head: | ||
runs-on: ubuntu-latest | ||
|
@@ -99,21 +58,6 @@ jobs: | |
matrix: | ||
node-version: [20.5.1] | ||
|
||
services: | ||
db: | ||
image: postgres:13 | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_DB: misskey | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
POSTGRES_USER: example-misskey-user | ||
POSTGRESS_PASS: example-misskey-pass | ||
redis: | ||
image: redis:7 | ||
ports: | ||
- 6379:6379 | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -134,43 +78,17 @@ jobs: | |
- 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 | ||
run: pnpm build | ||
- name : Migrate | ||
run: pnpm migrate | ||
- name: Launch misskey | ||
run: | | ||
screen -S misskey -dm pnpm run dev | ||
sleep 30s | ||
- name: Wait for Misskey to be ready | ||
run: | | ||
MAX_RETRIES=12 | ||
RETRY_DELAY=5 | ||
count=0 | ||
until $(curl --output /dev/null --silent --head --fail http://localhost:3000) || [[ $count -eq $MAX_RETRIES ]]; do | ||
printf '.' | ||
sleep $RETRY_DELAY | ||
count=$((count + 1)) | ||
done | ||
if [[ $count -eq $MAX_RETRIES ]]; then | ||
echo "Failed to connect to Misskey after $MAX_RETRIES attempts." | ||
exit 1 | ||
fi | ||
- id: fetch | ||
name: Get api.json from Misskey | ||
run: | | ||
RESULT=$(curl --retry 5 --retry-delay 5 --retry-max-time 60 http://localhost:3000/api.json) | ||
echo $RESULT > api-head.json | ||
- name: Generate API JSON | ||
run: pnpm --filter backend generate-api-json | ||
- name: Copy API.json | ||
run: cp packages/backend/built/api.json api-head.json | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: api-artifact | ||
path: api-head.json | ||
- name: Kill Misskey Job | ||
run: screen -S misskey -X quit | ||
|
||
save-pr-number: | ||
runs-on: ubuntu-latest | ||
|