build(deps): bump actions/upload-artifact from 4.6.2 to 5.0.0 #245
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: | |
| branches: | |
| - master | |
| - '3.x' | |
| paths-ignore: | |
| - '*.md' | |
| pull_request: | |
| paths-ignore: | |
| - '*.md' | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| permissions: | |
| checks: write # for coverallsapp/github-action to create new checks | |
| contents: read # for actions/checkout to fetch code | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| name: | |
| - Node.js 18.x | |
| - Node.js 19.x | |
| - Node.js 20.x | |
| - Node.js 21.x | |
| - Node.js 22.x | |
| include: | |
| - name: Node.js 18.x | |
| node-version: "18" | |
| - name: Node.js 19.x | |
| node-version: "19" | |
| - name: Node.js 20.x | |
| node-version: "20" | |
| - name: Node.js 21.x | |
| node-version: "21" | |
| - name: Node.js 22.x | |
| node-version: "22" | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Install Node.js ${{ matrix.node-version }} | |
| shell: bash -eo pipefail -l {0} | |
| run: | | |
| nvm install --default ${{ matrix.node-version }} | |
| dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" | |
| - name: Configure npm | |
| run: | | |
| if [[ "$(npm config get package-lock)" == "true" ]]; then | |
| npm config set package-lock false | |
| else | |
| npm config set shrinkwrap false | |
| fi | |
| - name: Remove npm module(s) ${{ matrix.npm-rm }} | |
| run: npm rm --silent --save-dev ${{ matrix.npm-rm }} | |
| if: matrix.npm-rm != '' | |
| - name: Install npm module(s) ${{ matrix.npm-i }} | |
| run: npm install --save-dev ${{ matrix.npm-i }} | |
| if: matrix.npm-i != '' | |
| - name: Install Node.js dependencies | |
| run: npm install | |
| - name: List environment | |
| id: list_env | |
| shell: bash | |
| run: | | |
| echo "node@$(node -v)" | |
| echo "npm@$(npm -v)" | |
| npm -s ls ||: | |
| (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }' | |
| - name: Run tests | |
| shell: bash | |
| run: | | |
| if npm -ps ls nyc | grep -q nyc; then | |
| npm run test-ci | |
| else | |
| npm test | |
| fi | |
| - name: Lint code | |
| if: steps.list_env.outputs.eslint != '' | |
| run: npm run lint | |
| - name: Collect code coverage | |
| uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # master | |
| if: steps.list_env.outputs.nyc != '' | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| flag-name: run-${{ matrix.test_number }} | |
| parallel: true | |
| test-minimum-node: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: get minimum node version | |
| id: node | |
| run: | | |
| ENGINES=$(jq -r .engines.node package.json) | |
| MIN_NODE=$(echo "$ENGINES" | grep -oE '[0-9]+(\.[0-9]+)?(\.[0-9]+)?' | head -n 1) | |
| echo "NODE_VERSION=$MIN_NODE" >> $GITHUB_ENV | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - run: npm install | |
| - run: npm test | |
| coverage: | |
| permissions: | |
| checks: write # for coverallsapp/github-action to create new checks | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Upload code coverage | |
| uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # master | |
| with: | |
| github-token: ${{ secrets.github_token }} | |
| parallel-finished: true |