FIX: Linting and type errors. #25
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 | |
| - "develop/*" | |
| - "feature/*" | |
| pull_request: | |
| branches: [main] | |
| # Ensure only one workflow runs per ref/PR at a time | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| setup: | |
| name: Setup | |
| runs-on: ubuntu-latest | |
| outputs: | |
| cache-hit: ${{ steps.pnpm-cache.outputs.cache-hit }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22.12.0" # Using version from volta config | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: "9.15.4" # Using version from packageManager field | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - name: Setup pnpm cache | |
| id: cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Paraglide compile (i18n) | |
| run: pnpm exec paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide | |
| - name: Cache node_modules and paraglide output | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| src/lib/paraglide | |
| key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| lint: | |
| name: Linting | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22.12.0" | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: "9.15.4" | |
| run_install: false | |
| - name: Restore cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| src/lib/paraglide | |
| key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| - name: Run Prettier check | |
| run: pnpm run lint | |
| type-check: | |
| name: Type Checking | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22.12.0" | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: "9.15.4" | |
| run_install: false | |
| - name: Restore cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| node_modules | |
| src/lib/paraglide | |
| key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| - name: Run TypeScript check | |
| run: pnpm run check | |
| test: | |
| name: Tests | |
| needs: [lint, type-check] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22.12.0" | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: "9.15.4" | |
| run_install: false | |
| - name: Restore cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| node_modules | |
| src/lib/paraglide | |
| key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| - name: Run tests | |
| run: pnpm run test | |
| build: | |
| name: Build | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22.12.0" | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: "9.15.4" | |
| run_install: false | |
| - name: Restore cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| node_modules | |
| src/lib/paraglide | |
| key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| - name: Build application | |
| run: pnpm run build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-output | |
| path: build | |
| retention-days: 1 |