chore(deps): update actions/checkout action to v4 #765
This file contains 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: | |
- main | |
- renovate/** | |
pull_request: | |
env: | |
NODE_VERSION: 'lts/*' | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
node: [ '6', '8', '10', '12', '14', '16', '18', '20' ] | |
name: Unit tests (Node v${{ matrix.node }}) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'yarn' | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
id: cache-nodemodules | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-${{ matrix.node }}-nodemodules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile --non-interactive | |
- name: Unit tests | |
run: yarn test | |
- name: Upload code coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage/coverage-final.json | |
name: codecov-umbrella | |
fail_ci_if_error: true | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'yarn' | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
id: cache-nodemodules | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-nodemodules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile --non-interactive | |
- name: Lint | |
run: yarn lint | |
release: | |
needs: [tests, lint] | |
if: github.ref == 'refs/heads/main' | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'yarn' | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
id: cache-nodemodules | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-nodemodules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile --non-interactive | |
- name: Release | |
run: npx semantic-release --branches main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |