test: improve coverage #466
Workflow file for this run
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: | |
pull_request: | |
push: | |
jobs: | |
commitlint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: | | |
- args: [--frozen-lockfile, --strict-peer-dependencies] | |
- name: Install commitlint | |
run: | | |
pnpm install -w conventional-changelog-conventionalcommits | |
pnpm install -w commitlint@latest | |
- name: Validate current commit (last commit) with commitlint | |
if: github.event_name == 'push' | |
run: pnpm exec commitlint --last --verbose | |
- name: Validate PR commits with commitlint | |
if: github.event_name == 'pull_request' | |
run: pnpm exec commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose | |
test: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: | | |
- args: [--frozen-lockfile, --strict-peer-dependencies] | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: | | |
PLAYWRIGHT_VERSION=$(cat pnpm-lock.yaml | grep playwright-core | head -n 1 | cut -d '@' -f 2) | |
echo "PLAYWRIGHT_VERSION=${PLAYWRIGHT_VERSION}" >> $GITHUB_ENV | |
- name: Build | |
run: pnpm build | |
- name: Install Playwright Browsers | |
run: pnpm -F ccstate-devtools playwright install --with-deps | |
- name: lint | |
run: pnpm lint | |
- name: test | |
run: pnpm test | |
- name: bench | |
uses: CodSpeedHQ/action@v3 | |
with: | |
run: CI=true pnpm bench | |
token: ${{ secrets.CODSPEED_TOKEN }} | |
- name: 'Report Coverage' | |
uses: davelosert/vitest-coverage-report-action@v2 | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: coverage/cobertura-coverage.xml | |
format: cobertura | |
fail-on-error: true |