1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- name: "Lint and run tests"
- on:
- pull_request:
- branches: [main]
- workflow_dispatch:
- jobs:
- lint-and-test:
- name: Lint and Test
- runs-on: ubuntu-latest
- timeout-minutes: 4
- strategy:
- matrix:
- node-version: [22]
- env:
- CI: "true"
- STORE_PATH: ""
- PNPM_VERSION: 9
- 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
|