ci: add shared build job to eliminate redundant make build in test and lint
Extract make build into a dedicated build job that uploads artifacts (bin/probod, frontend dist, emails dist). Both test and lint jobs now download these artifacts instead of rebuilding from scratch. This eliminates ~172 compute minutes/week of redundant builds while keeping wall-clock time neutral (test and lint were spending their first ~2min building anyway).
This commit is contained in:
committed by
Bryan Frimin
parent
76e1c17a24
commit
1921445a73
46
.github/workflows/make.yaml
vendored
46
.github/workflows/make.yaml
vendored
@@ -89,8 +89,39 @@ jobs:
|
|||||||
severity-cutoff: critical
|
severity-cutoff: critical
|
||||||
output-format: table
|
output-format: table
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: "build"
|
||||||
|
runs-on: "ubuntu-22.04"
|
||||||
|
permissions:
|
||||||
|
contents: "read"
|
||||||
|
steps:
|
||||||
|
- uses: "actions/checkout@v6"
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- uses: "actions/setup-go@v6"
|
||||||
|
with:
|
||||||
|
go-version: "1.26.1"
|
||||||
|
cache: true
|
||||||
|
- uses: "actions/setup-node@v6"
|
||||||
|
with:
|
||||||
|
node-version-file: ".nvmrc"
|
||||||
|
cache: "npm"
|
||||||
|
- run: "npm i -g npm@11.8.0"
|
||||||
|
- run: "npm ci"
|
||||||
|
- run: "make build"
|
||||||
|
- uses: "actions/upload-artifact@v6"
|
||||||
|
with:
|
||||||
|
name: "build-artifacts"
|
||||||
|
path: |
|
||||||
|
bin/probod
|
||||||
|
apps/console/dist/
|
||||||
|
apps/trust/dist/
|
||||||
|
packages/emails/dist/
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
name: "lint"
|
name: "lint"
|
||||||
|
needs: [build]
|
||||||
runs-on: "ubuntu-22.04"
|
runs-on: "ubuntu-22.04"
|
||||||
permissions:
|
permissions:
|
||||||
contents: "read"
|
contents: "read"
|
||||||
@@ -111,11 +142,15 @@ jobs:
|
|||||||
install-only: true
|
install-only: true
|
||||||
- run: "npm i -g npm@11.8.0"
|
- run: "npm i -g npm@11.8.0"
|
||||||
- run: "npm ci"
|
- run: "npm ci"
|
||||||
- run: "make build"
|
- uses: "actions/download-artifact@v6"
|
||||||
|
with:
|
||||||
|
name: "build-artifacts"
|
||||||
|
- run: "chmod +x bin/probod"
|
||||||
- run: "make lint"
|
- run: "make lint"
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: "test"
|
name: "test"
|
||||||
|
needs: [build]
|
||||||
runs-on: "ubuntu-22.04"
|
runs-on: "ubuntu-22.04"
|
||||||
permissions:
|
permissions:
|
||||||
contents: "read"
|
contents: "read"
|
||||||
@@ -127,13 +162,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: "1.26.1"
|
go-version: "1.26.1"
|
||||||
cache: true
|
cache: true
|
||||||
- uses: "actions/setup-node@v6"
|
- uses: "actions/download-artifact@v6"
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
name: "build-artifacts"
|
||||||
cache: "npm"
|
- run: "chmod +x bin/probod"
|
||||||
- run: "npm i -g npm@11.8.0"
|
|
||||||
- run: "npm ci"
|
|
||||||
- run: "make build"
|
|
||||||
- run: "make test"
|
- run: "make test"
|
||||||
env:
|
env:
|
||||||
GOTESTSUM_JUNITFILE: "junit.xml"
|
GOTESTSUM_JUNITFILE: "junit.xml"
|
||||||
|
|||||||
Reference in New Issue
Block a user