diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9c61945..64bb4cb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,30 +1,28 @@ ---- name: Test -on: - pull_request: - types: [opened, synchronize, reopened, ready_for_review] +on: pull_request jobs: test: runs-on: ubuntu-latest + timeout-minutes: 10 steps: - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: '18' - - uses: actions/checkout@v3 - - env: - cache-name: cache-node-modules - name: 'Cache node modules' - uses: actions/cache@v3 + + - name: Use dependencies cache + uses: actions/cache@v4 with: - key: "${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}" path: ~/.npm - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - name: Install Dependencies - run: npm ci + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: npm- + + - name: Install dependencies + run: npm ci --ignore-scripts --no-audit --no-fund + - name: Test - run: 'npm run test' + run: npm run test