diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml index 9ea2fdbd..4e6f6ced 100644 --- a/.github/workflows/frontend-ci.yml +++ b/.github/workflows/frontend-ci.yml @@ -20,41 +20,63 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + - name: Restore pnpm cache + uses: actions/cache/restore@v4 + id: pnpm-cache + with: + path: ~/.pnpm-store + key: pnpm-${{ hashFiles('frontend/pnpm-lock.yaml') }} + restore-keys: | + pnpm- - name: Install pnpm uses: pnpm/action-setup@v4 with: package_json_file: frontend/package.json - run_install: false - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - cache-dependency-path: frontend/pnpm-lock.yaml - - name: Install dependencies - run: pnpm install + - run: pnpm install --frozen-lockfile --strict-peer-dependencies - name: Lint run: pnpm run --recursive --parallel --aggregate-output lint + + - name: Save pnpm cache + if: steps.pnpm-cache.outputs.cache-hit != 'true' # && github.ref == 'refs/heads/main' + uses: actions/cache/save@v4 + with: + path: ~/.pnpm-store + key: ${{ steps.pnpm-cache.outputs.cache-primary-key }} test: name: Test runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + - name: Restore pnpm cache + uses: actions/cache/restore@v4 + id: pnpm-cache + with: + path: ~/.pnpm-store + key: pnpm-${{ hashFiles('frontend/pnpm-lock.yaml') }} + restore-keys: | + pnpm- - name: Install pnpm uses: pnpm/action-setup@v4 with: package_json_file: frontend/package.json - run_install: false - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - cache-dependency-path: frontend/pnpm-lock.yaml - - name: Install dependencies - run: pnpm install + - run: pnpm install --frozen-lockfile --strict-peer-dependencies - name: Test run: pnpm run --recursive --parallel --aggregate-output test + + - name: Save pnpm cache + if: steps.pnpm-cache.outputs.cache-hit != 'true' # && github.ref == 'refs/heads/main' + uses: actions/cache/save@v4 + with: + path: ~/.pnpm-store + key: ${{ steps.pnpm-cache.outputs.cache-primary-key }}