Update Node.js to v24 #1277
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: CI | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| DEFAULT_NODE_VERSION: 22.x | |
| jobs: | |
| tooling: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: | |
| - 20.x | |
| - 22.x | |
| - 24.x | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: yarn | |
| - run: yarn install --immutable | |
| - run: yarn lint | |
| - run: yarn depcheck | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: | |
| - 20.x | |
| - 22.x | |
| - 24.x | |
| os: | |
| - macos-latest | |
| - ubuntu-latest | |
| - windows-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: yarn | |
| - run: yarn install --immutable | |
| - run: yarn build | |
| - run: yarn test | |
| - name: Submit coverage results | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ secrets.github_token }} | |
| flag-name: run-${{ matrix.node-version }} | |
| parallel: true | |
| coveralls: | |
| name: Coverage check | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Consolidate test coverage from different jobs | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ secrets.github_token }} | |
| parallel-finished: true | |
| spec: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: | |
| - 20.x | |
| - 22.x | |
| - 24.x | |
| os: | |
| - macos-latest | |
| - ubuntu-latest | |
| - windows-latest | |
| - macos-14 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: yarn | |
| - run: yarn install --immutable | |
| - run: yarn build | |
| - name: Load RDF test suite cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| .rdf-test-suite-cache | |
| key: rdftestsuite-${{ hashFiles('yarn.lock') }} | |
| - run: yarn spec:all | |
| - name: Generate earl | |
| if: matrix.node-version == '22.x' && matrix.os == 'ubuntu-latest' | |
| run: yarn spec:earl | |
| - name: Upload earl | |
| if: matrix.node-version == '22.x' && matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: earl report | |
| path: engines/*/spec/earl-*.ttl | |
| documentation: | |
| name: Prepare documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Ensure line endings are consistent | |
| run: git config --global core.autocrlf input | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.DEFAULT_NODE_VERSION }} | |
| cache: yarn | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Build documentation | |
| run: yarn run doc | |
| - name: Prepare artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: documentation | |
| name: documentation | |
| documentation-publish: | |
| name: Publish documentation | |
| needs: | |
| - documentation | |
| runs-on: ubuntu-latest | |
| # The documentation is only published for main branch | |
| if: startsWith(github.ref, 'refs/heads/main') | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 | |
| with: | |
| artifact_name: documentation |