You've already forked AstralRinth
forked from didirus/AstralRinth
devex: skip services + env + db steps in CI if not needed (#4965)
This commit is contained in:
22
.github/workflows/turbo-ci.yml
vendored
22
.github/workflows/turbo-ci.yml
vendored
@@ -70,19 +70,33 @@ jobs:
|
|||||||
- name: 🧰 Install dependencies
|
- name: 🧰 Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install
|
||||||
|
|
||||||
|
- name: ⚙️ Set app environment
|
||||||
|
working-directory: packages/app-lib
|
||||||
|
run: cp .env.staging .env
|
||||||
|
|
||||||
|
# check if labrinth tests will actually run (cache miss)
|
||||||
|
- name: 🔍 Check if labrinth tests need to run
|
||||||
|
id: check-labrinth
|
||||||
|
run: |
|
||||||
|
LABRINTH_TEST_STATUS=$(pnpm turbo run test --filter=@modrinth/labrinth --dry-run=json | jq -r '.tasks[] | select(.task == "test") | .cache.status')
|
||||||
|
echo "Labrinth test cache status: $LABRINTH_TEST_STATUS"
|
||||||
|
if [ "$LABRINTH_TEST_STATUS" = "HIT" ]; then
|
||||||
|
echo "needs_services=false" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "needs_services=true" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: ⚙️ Start services
|
- name: ⚙️ Start services
|
||||||
|
if: steps.check-labrinth.outputs.needs_services == 'true'
|
||||||
run: docker compose up --wait
|
run: docker compose up --wait
|
||||||
|
|
||||||
- name: ⚙️ Setup labrinth environment and database
|
- name: ⚙️ Setup labrinth environment and database
|
||||||
|
if: steps.check-labrinth.outputs.needs_services == 'true'
|
||||||
working-directory: apps/labrinth
|
working-directory: apps/labrinth
|
||||||
run: |
|
run: |
|
||||||
cp .env.local .env
|
cp .env.local .env
|
||||||
sqlx database setup
|
sqlx database setup
|
||||||
|
|
||||||
- name: ⚙️ Set app environment
|
|
||||||
working-directory: packages/app-lib
|
|
||||||
run: cp .env.staging .env
|
|
||||||
|
|
||||||
- name: 🔍 Lint and test
|
- name: 🔍 Lint and test
|
||||||
run: pnpm run ci
|
run: pnpm run ci
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user