9.3.0 #41
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: Node.js CI & Release | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| FORCE_COLOR: 2 | |
| NODE_COV: lts/* | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: | |
| - 14 | |
| - 16 | |
| - 18 | |
| - lts/* | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install npm dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build --if-present | |
| - name: Run Jest | |
| run: npm test | |
| - name: Run Jest with coverage | |
| run: npm run cover | |
| if: matrix.node == env.NODE_COV | |
| - name: Run Coveralls | |
| uses: coverallsapp/[email protected] | |
| if: matrix.node == env.NODE_COV | |
| continue-on-error: true | |
| with: | |
| github-token: '${{ secrets.GITHUB_TOKEN }}' | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: lts/* | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Release with semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: npx semantic-release |