Run Test Suite #263
Workflow file for this run
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: Run Test Suite | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| release: | |
| types: [published, prereleased] | |
| permissions: {} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Run tests | |
| run: npm run test-coverage | |
| env: | |
| NODE_OPTIONS: --experimental-vm-modules | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage/lcov.info | |
| fail_ci_if_error: false | |
| verbose: true | |
| publish: | |
| name: >- | |
| Publish cli 📦 to NPM | |
| if: | |
| github.repository_owner == 'all-contributors' && github.event_name == | |
| 'release' | |
| needs: | |
| - test | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: npm-publish | |
| url: https://www.npmjs.com/package/all-contributors-cli | |
| permissions: | |
| id-token: write # mandatory for OIDC / NPM publishing | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| # Ensure npm 11.5.1 or later for trusted publishing | |
| - run: npm install -g npm@latest | |
| - run: | | |
| npm --version | |
| npm ci | |
| npm run build | |
| - run: npm publish --provenance |