Skip to content

Merge pull request #21 from leodutra/dependabot/npm_and_yarn/esbuild-… #125

Merge pull request #21 from leodutra/dependabot/npm_and_yarn/esbuild-…

Merge pull request #21 from leodutra/dependabot/npm_and_yarn/esbuild-… #125

Workflow file for this run

name: CI
permissions:
contents: read
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run lint
test:
runs-on: ubuntu-latest
env:
CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }}
strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x, lts/*, node]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Type-check sources
run: npm run type-check
- name: Run tests with coverage and generate LCOV
run: npm run test:coverage:ci
- name: Upload coverage to Coveralls
if: matrix.node-version == 'lts/*'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage/lcov.info
continue-on-error: true
- name: Upload coverage to Codacy
if: matrix.node-version == 'lts/*' && env.CODACY_API_TOKEN != ''
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ env.CODACY_API_TOKEN }}
coverage-reports: ./coverage/lcov.info
continue-on-error: true
benchmark:
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Type-check sources
run: npm run type-check
- name: Run benchmark
run: |
npm run benchmark > benchmark-results.txt
echo "## 🚀 Benchmark Results" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat benchmark-results.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: benchmark-results.txt
retention-days: 30