Harden CI workflow with permissions, concurrency, and caching
Some checks failed
CI / validate (push) Failing after 7m8s
Some checks failed
CI / validate (push) Failing after 7m8s
This commit is contained in:
42
.github/workflows/ci.yml
vendored
42
.github/workflows/ci.yml
vendored
@@ -4,19 +4,43 @@ on:
|
|||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ci-${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
validate:
|
validate:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- uses: actions/setup-node@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# setup-node asks pnpm for its store path when cache: pnpm is enabled,
|
||||||
|
# so pnpm must already be installed and available on PATH.
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 10.15.0
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18.20.8
|
node-version: 18.20.8
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
- uses: pnpm/action-setup@v4
|
cache-dependency-path: pnpm-lock.yaml
|
||||||
with:
|
|
||||||
version: 10.15.0
|
- name: Install dependencies
|
||||||
- run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
- run: pnpm test
|
|
||||||
- run: pnpm typecheck
|
- name: Test
|
||||||
- run: pnpm build
|
run: pnpm test
|
||||||
|
|
||||||
|
- name: Typecheck
|
||||||
|
run: pnpm typecheck
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: pnpm build
|
||||||
|
|||||||
Reference in New Issue
Block a user