diff --git a/.github/workflows/command-rebase.yml b/.github/workflows/command-rebase.yml index 2f123d1f..b3633e3b 100644 --- a/.github/workflows/command-rebase.yml +++ b/.github/workflows/command-rebase.yml @@ -31,7 +31,7 @@ jobs: reaction-type: "+1" - name: Checkout the latest code - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.2 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2 with: fetch-depth: 0 token: ${{ secrets.COMMAND_BOT_PAT }} diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index b02042c1..28a5e67e 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -24,7 +24,7 @@ jobs: name: e2e runner ${{ matrix.containers }} steps: - name: Checkout - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.2 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2 - name: Read package.json node and npm engines version uses: skjnldsv/read-package-engines-version-actions@v2.2 # v2.1 @@ -65,7 +65,7 @@ jobs: CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - name: Collect coverage - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v3.1.4 with: files: ./coverage/lcov.info @@ -81,7 +81,7 @@ jobs: name: component runner ${{ matrix.containers }} steps: - name: Checkout - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.2 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2 - name: Read package.json node and npm engines version uses: skjnldsv/read-package-engines-version-actions@v2.2 # v2.1 @@ -121,7 +121,7 @@ jobs: CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - name: Collect coverage - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 with: files: ./coverage/lcov.info diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b04f8245..318dc72e 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -12,7 +12,7 @@ jobs: name: Build and deploy steps: - name: Checkout - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.2 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2 - name: Read package.json node and npm engines version uses: skjnldsv/read-package-engines-version-actions@v2.2 # v2.1 diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml index b90d82bf..36252043 100644 --- a/.github/workflows/node-test.yml +++ b/.github/workflows/node-test.yml @@ -1,4 +1,4 @@ -name: Node +name: Node tests on: pull_request: @@ -8,45 +8,54 @@ on: - master - stable* +permissions: + contents: read + +concurrency: + group: node-tests-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest - permissions: - checks: write - pull-requests: write - strategy: - matrix: - node-version: [ 16, 18 ] - include: - - node-version: 16 - coverage: coverage - - name: test + steps: - name: Checkout - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - - name: Set up node ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2 + id: versions with: - node-version: ${{ matrix.node-version }} + fallbackNode: '^20' + fallbackNpm: '^9' - - name: Install dependencies - run: npm ci + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" + + - name: Install dependencies & build + env: + CYPRESS_INSTALL_BINARY: 0 + run: | + npm ci + npm run build --if-present - name: Test run: npm run test --if-present - name: Test and process coverage - if: matrix.coverage - run: npm run test:coverage + run: npm run test:coverage --if-present - name: Collect coverage - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 with: files: ./coverage/lcov.info - summary: runs-on: ubuntu-latest needs: test diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml deleted file mode 100644 index f3e2ea41..00000000 --- a/.github/workflows/node.yml +++ /dev/null @@ -1,71 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Node - -on: - pull_request: - paths: - - '.github/workflows/**' - - 'src/**' - - 'appinfo/info.xml' - - 'package.json' - - 'package-lock.json' - - 'tsconfig.json' - - '**.js' - - '**.ts' - - '**.vue' - push: - branches: - - main - - master - - stable* - -permissions: - contents: read - -concurrency: - group: node-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - - name: node - steps: - - name: Checkout - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.2 - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@v2.2 # v2.1 - id: versions - with: - fallbackNode: '^16' - fallbackNpm: '^7' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" - - - name: Install dependencies & build - run: | - npm ci - npm run build --if-present - - - name: Check webpack build changes - run: | - bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)" - - - name: Show changes on failure - if: failure() - run: | - git status - git --no-pager diff - exit 1 # make it red to grab attention diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 4284ac57..1f4eb4fa 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -19,7 +19,7 @@ jobs: name: Build and publish to npm steps: - name: Checkout - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.2 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2 - name: Read package.json node and npm engines version uses: skjnldsv/read-package-engines-version-actions@v2.2 # v2.1