ci: fixed custom action for repeated env setup #8
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: Code testing & coverage | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| testing: | |
| runs-on: ubuntu-latest | |
| concurrency: ci-test-${{ github.ref }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js with cache | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Enable corepack | |
| run: npm i -g corepack@latest && corepack enable | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ env.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: Test | |
| run: pnpm test | |
| # - name: Upload coverage | |
| # uses: codecov/codecov-action@v2 | |
| # with: | |
| # token: ${{ secrets.CODECOV_TOKEN }} | |
| # flags: unittests |