Refactor CI workflows #584
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: Continuous Integration | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize, ready_for_review] | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
# ––––––––––––––––––––––––––––––––––––––––––––––– # | |
# Lint & Format | |
# ––––––––––––––––––––––––––––––––––––––––––––––– # | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup node.js/npm | |
uses: ./.github/actions/setup-node | |
- name: Run linter | |
run: npm run lint | |
- name: Check format | |
run: npm run check-format | |
# ––––––––––––––––––––––––––––––––––––––––––––––– # | |
# Test | |
# ––––––––––––––––––––––––––––––––––––––––––––––– # | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup node.js/npm | |
uses: ./.github/actions/setup-node | |
- name: Run unit tests | |
run: npm run test | |
- name: Report coverage | |
if: success() | |
uses: davelosert/vitest-coverage-report-action@v2 | |
# ––––––––––––––––––––––––––––––––––––––––––––––– # | |
# Build the application | |
# ––––––––––––––––––––––––––––––––––––––––––––––– # | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup node.js/npm | |
uses: ./.github/actions/setup-node | |
- name: Build | |
run: npm run build |