Version 2.0.0 #12
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: "Lint and run tests" | |
on: | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
lint-and-test: | |
name: Lint and Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22] | |
env: | |
CI: "true" | |
STORE_PATH: "" | |
PNPM_VERSION: 9 | |
environment: "Unit Tests" | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Node.js v${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
run_install: false | |
- name: Set up pnpm store directory | |
shell: bash | |
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- name: Set up pnpm cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: ${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
shell: bash | |
run: pnpm install | |
- name: Lint the code | |
shell: bash | |
run: pnpm run lint | |
- name: Run unit tests | |
shell: bash | |
run: | | |
echo "${{ secrets.DOTENV_FILE }}" > .env | |
pnpm run test |