feat: first commit #1
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, pull_request] | |
jobs: | |
lint: | |
name: Lint | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: install dependencies | |
run: npm ci | |
- name: lint code | |
run: npm run lint | |
build: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
node: ['16', '18', '20'] | |
name: Tests - Node ${{ matrix.node }} (${{ matrix.platform }}) | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: install dependencies | |
run: npm ci --ignore-engines | |
- name: run tests | |
run: npm run test | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
coverage: | |
name: Coverage | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: install dependencies | |
run: npm ci | |
- name: run tests | |
run: npm run test | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
release: | |
name: do semantic release | |
runs-on: 'ubuntu-latest' | |
permissions: | |
contents: write | |
issues: write | |
needs: build | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: install dependencies | |
run: npm ci --ignore-engines | |
- name: release | |
run: npm run semantic-release | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} |