fix: showing dependencies stage for modpack #6584
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: [opened, synchronize] | |
| merge_group: | |
| types: [checks_requested] | |
| jobs: | |
| build: | |
| name: Lint and Test | |
| runs-on: ubuntu-latest | |
| env: | |
| # Ensure pnpm output is colored in GitHub Actions logs | |
| FORCE_COLOR: 3 | |
| # Make cargo nextest successfully ignore projects without tests | |
| NEXTEST_NO_TESTS: pass | |
| # Fail on warnings in CI | |
| # (but don't do this in the root `Cargo.toml`, | |
| # since we don't want warnings to become errors | |
| # while developing) | |
| RUSTFLAGS: -Dwarnings | |
| steps: | |
| - name: 📥 Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: 🧰 Install build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -yq libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev | |
| - name: 🧰 Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: 🧰 Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: 🧰 Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: '' | |
| components: clippy, rustfmt | |
| cache: false | |
| - name: 🧰 Setup nextest | |
| uses: taiki-e/install-action@nextest | |
| # cargo-binstall does not have pre-built binaries for sqlx-cli, so we fall | |
| # back to a cached cargo install | |
| - name: 🧰 Setup cargo-sqlx | |
| uses: taiki-e/cache-cargo-install-action@v2 | |
| with: | |
| tool: sqlx-cli | |
| locked: false | |
| no-default-features: true | |
| features: rustls,postgres | |
| - name: 💨 Setup Turbo cache | |
| uses: rharkor/[email protected] | |
| - name: 🧰 Install dependencies | |
| 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 | |
| if: steps.check-labrinth.outputs.needs_services == 'true' | |
| run: docker compose up --wait | |
| - name: ⚙️ Setup labrinth environment and database | |
| if: steps.check-labrinth.outputs.needs_services == 'true' | |
| working-directory: apps/labrinth | |
| run: | | |
| cp .env.local .env | |
| sqlx database setup | |
| - name: 🔍 Lint and test | |
| run: pnpm run ci | |
| - name: 🔍 Verify intl:extract has been run | |
| run: | | |
| pnpm turbo run intl:extract --force | |
| git diff --exit-code --color */*/src/locales/en-US/index.json |