use v4 instead of v3 as it is deprecated #211
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: Test | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| - develop | |
| env: | |
| NODE_VERSION: 20.x | |
| jobs: | |
| install-and-cache: | |
| name: Run install and cache | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| - name: Cache node_modules | |
| id: cached-node-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-${{ hashFiles('package-lock.json') }}-${{ env.NODE_VERSION }} | |
| - name: Install dependencies | |
| if: steps.cached-node-modules.outputs.cache-hit != 'true' | |
| run: npm ci | |
| eslint: | |
| name: eslint | |
| needs: [install-and-cache] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Cache node_modules | |
| id: cached-node-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-${{ hashFiles('package-lock.json') }}-${{ env.NODE_VERSION }} | |
| - name: run eslint | |
| run: npm run lint | |
| test: | |
| name: Run tests | |
| runs-on: ubuntu-latest | |
| needs: [install-and-cache] | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Cache node_modules | |
| id: cached-node-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-${{ hashFiles('package-lock.json') }}-${{ env.NODE_VERSION }} | |
| - name: Install dependencies | |
| if: steps.cached-node-modules.outputs.cache-hit != 'true' | |
| run: npm ci | |
| - name: Test | |
| run: | | |
| npm run test | |
| npm run build | |