Skip to content

✨ feat: Changes

✨ feat: Changes #4

Workflow file for this run

name: QA checks
on:
pull_request:
branches:
- main
push:
branches:
- docs
jobs:
lint:
name: Lint, Typecheck, Test and Build source files
runs-on: [ self-hosted, Linux ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Lint source files
run: npm run lint
- name: Check types
run: npm run typecheck
- name: Run tests
run: npm run test:coverage
- name: Build package
run: npm run build
- name: 'Report Coverage'
if: always()
uses: davelosert/vitest-coverage-report-action@v2
- name: Get coverage percentage and branch
id: coverage
run: |
PERCENT=$(node -p "require('./coverage/coverage-summary.json').total.lines.pct")
echo "percent=$PERCENT" >> "$GITHUB_OUTPUT"
BRANCH=${GITHUB_REF#refs/heads/}
echo "branch=$BRANCH" >> "${GITHUB_OUTPUT}"
echo "x-$PERCENT"
echo "x-$BRANCH"
shell: bash
- uses: actions/checkout@v4
with:
ref: gh-badges
- name: Create badges directory
run: mkdir -p "${{ steps.coverage.outputs.branch }}"
shell: bash
- name: Generate badge
uses: emibcn/badge-action@v2.0.2
with:
label: coverage
status: ${{ steps.coverage.outputs.percent }}
color: 44cc11
path: ${{ steps.coverage.outputs.branch }}/coverage.svg
- name: Commit files
run: |
git config --local user.email "${{ github.actor_id }}+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git status
# git commit -m "Update badges"
#
# - name: Push changes
# uses: ad-m/github-push-action@v0.8.0
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: gh-badges