Fold lint into build job to avoid duplicate dependency install
Lint, build, test and deploy / build (push) Successful in 1m39s
Lint, build, test and deploy / test (push) Successful in 5s
Lint, build, test and deploy / deploy (push) Successful in 3s

This commit is contained in:
Leon Xu committed 2026-11-29 14:53:35 -08:00
1 parent c049512b92
commit b0c62de391
2 files changed
+17 -31

No files matched your search

+6 -22
View File
@@ -6,28 +6,9 @@ on:
workflow_dispatch:
jobs:
# ------------------------------------------------------------ style checks
# Runs in parallel with build; both must pass before the site is tested.
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint Markdown
run: npx markdownlint-cli2
# ------------------------------------------------------------ build
# Produces the static site once and shares it as an artifact so the
# test and deploy stages never rebuild.
# Single dependency install serves both the lint check and the build.
# Lint failures fail this job, which gates test and deploy.
build:
runs-on: ubuntu-latest
steps:
@@ -45,6 +26,9 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint Markdown
run: npx markdownlint-cli2
- name: Build site
run: hexo generate
@@ -69,7 +53,7 @@ jobs:
# Validates the built site locally. Never touches production. Deploy
# physically cannot run unless this job passes.
test:
needs: [lint, build]
needs: build
runs-on: ubuntu-latest
steps:
- name: Download site artifact