diff --git a/.github/checks.yml b/.github/checks.yml deleted file mode 100644 index 4c8df07..0000000 --- a/.github/checks.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Checks - -on: - pull_request: # push is handled in the deploy workflows - branches: ["**"] - workflow_call: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - verify: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - command: [lint, type-check, test] - name: ${{ matrix.command }} - environment: Staging # Use staging env vars for testing - - steps: - - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 22 - - - name: Enable corepack - run: corepack enable pnpm - - - name: Get pnpm store directory - id: pnpm-cache - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - - name: Setup pnpm cache - uses: actions/cache@v4 - with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - # First tries exact match with lock file hash. If not found, - # falls back to any cache starting with 'pnpm-store-'. - # This way we get exact cache on repeated runs, but can still - # use older cache as starting point when dependencies change. - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Run ${{ matrix.command }} - run: pnpm ${{ matrix.command }} diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..f609fdc --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,45 @@ +name: Checks + +on: + pull_request: + branches: + - "**" + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + verify: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + command: ["lint", "type-check", "test", "build"] + + name: ${{ matrix.command }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "pnpm" + + - name: Enable corepack + run: corepack enable pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile --ignore-scripts + + - name: Run ${{ matrix.command }} + run: pnpm ${{ matrix.command }}