Adding initial docs setup #529
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: Build and Test | |
on: | |
merge_group: | |
workflow_dispatch: | |
pull_request: | |
branches: [main, v4] | |
push: | |
branches: [main, v4] | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
env: | |
NODE_VERSION: 22 | |
CACHE_KEY: "${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}" | |
jobs: | |
build: | |
name: Build Package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 10 | |
- name: Setup Node.js with pnpm caching | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Run build step | |
uses: ./.github/actions/build | |
with: | |
node: ${{ env.NODE_VERSION }} | |
- name: Save build artifacts | |
uses: actions/cache/save@v4 | |
with: | |
path: . | |
key: ${{ env.CACHE_KEY }} | |
coverage: | |
needs: build | |
name: Run Coverage Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [20, 22] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 10 | |
- name: Setup Node.js with pnpm caching | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: "pnpm" | |
- name: Restore build artifacts | |
uses: actions/cache/restore@v4 | |
with: | |
path: . | |
key: ${{ env.CACHE_KEY }} | |
- name: Run Test Coverage | |
run: pnpm test:coverage | |
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # [email protected] | |
lint: | |
needs: build # Require build to complete before running tests | |
name: Lint Code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 10 | |
- name: Setup Node.js with pnpm caching | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "pnpm" | |
- name: Restore build artifacts | |
uses: actions/cache/restore@v4 | |
with: | |
path: . | |
key: ${{ env.CACHE_KEY }} | |
- name: Run Lint | |
run: pnpm run lint |