chore: add support for region via a flag / env var #9
This file contains hidden or 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 & Test' | |
on: | |
push: | |
branches: | |
- master | |
- release/** | |
pull_request: | |
jobs: | |
job_build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9.15.5 | |
run_install: false | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: 'package.json' | |
cache: 'pnpm' | |
- name: Install dependencies with pnpm | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: Pack | |
run: pnpm pack | |
- name: Archive Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.sha }} | |
path: | | |
${{ github.workspace }}/*.tgz | |
job_lint: | |
name: Lint | |
needs: job_build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9.15.5 | |
run_install: false | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: 'package.json' | |
cache: 'pnpm' | |
- name: Install dependencies with pnpm | |
run: pnpm install --frozen-lockfile | |
- name: Run Linter | |
run: pnpm lint | |
job_test: | |
name: Node (${{ matrix.node }}) Unit Tests | |
needs: job_build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node: [18, 20, 22] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9.15.5 | |
run_install: false | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'pnpm' | |
- name: Install dependencies with pnpm | |
run: pnpm install --frozen-lockfile | |
- name: Run Unit Tests | |
run: pnpm test | |
- name: Push code coverage to codecov | |
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # [email protected] | |
with: | |
# Need to specify the token here, as the codecov action requires it for protected branches. | |
# If not set, this error is shown: `Token required because branch is protected` | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# Do not fail the build if codecov fails to report the coverage. | |
fail_ci_if_error: false | |
flags: unit-tests | |