diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b681bce..d103af2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,6 +82,8 @@ jobs: uses: actions/setup-node@v4 with: node-version: '22' + cache: npm + cache-dependency-path: package.json # The release asset is the userscript itself, so it ships only if its own suite passes. - name: Check userscript syntax diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ac9addd..fde1bae 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,11 +1,17 @@ name: Tests on: - push: - branches: ['**'] + # Test PRs once. Release publication tests the merged main commit separately. pull_request: workflow_dispatch: +permissions: + contents: read + +concurrency: + group: tests-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest @@ -17,6 +23,8 @@ jobs: uses: actions/setup-node@v4 with: node-version: '22' + cache: npm + cache-dependency-path: package.json - name: Check userscript syntax run: node --check javstore-full-layout-cleanup.user.js