Skip to content

Commit 64aee41

Browse files
committed
feat: add self-referential hashing and tighten GH workflows
1 parent 8e50bbe commit 64aee41

File tree

34 files changed

+2603
-460
lines changed

34 files changed

+2603
-460
lines changed

.cigen/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ dynamic: true # Generate separate workflow files
66
source_file_groups:
77
rust:
88
- "src/**/*.rs"
9+
- "plugins/**/*.rs"
10+
- "build.rs"
11+
- "proto/**/*.proto"
912
- "Cargo.toml"
1013
- "Cargo.lock"
1114

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
image: docspring/cigen-ci-runner:latest
2+
3+
steps:
4+
- name: Restore target cache
5+
uses: actions/cache@v4
6+
with:
7+
path: |
8+
target/release
9+
key: target-release-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
10+
11+
- run:
12+
name: Build cigen binary
13+
command: cargo build --release --bin cigen
14+
15+
- run:
16+
name: Prepare artifact bundle
17+
command: |
18+
set -e
19+
mkdir -p .cigen/bin
20+
cp target/release/cigen .cigen/bin/cigen
21+
22+
- uses: actions/upload-artifact@v4
23+
with:
24+
name: cigen-bin
25+
path: .cigen/bin/cigen

.cigen/workflows/ci/jobs/clippy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: rust:latest
1+
image: docspring/cigen-ci-runner:latest
22
source_files: "@rust"
33

44
steps:

.cigen/workflows/ci/jobs/fmt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: rust:latest
1+
image: docspring/cigen-ci-runner:latest
22
source_files: "@rust"
33

44
steps:

.cigen/workflows/ci/jobs/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: rust:latest
1+
image: docspring/cigen-ci-runner:latest
22
source_files:
33
- "@rust"
44
- "@tests"

.cigen/workflows/docs/jobs/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ requires:
44
- ci_gate
55

66
steps:
7-
- uses: actions/checkout@v4
8-
97
- name: Setup Node.js
108
uses: actions/setup-node@v4
119
with:

.cigen/workflows/docs/jobs/ci_gate.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
image: ubuntu-latest
22

33
steps:
4-
- uses: actions/checkout@v4
54
- name: Wait for CI checks to complete
65
uses: actions/github-script@v7
76
with:

.cigen/workflows/docs/jobs/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ requires:
55

66
environment:
77
name: github-pages
8-
url: ${{ steps.deployment.outputs.page_url }}
8+
url: https://docspring.github.io/cigen/
99

1010
steps:
1111
- name: Deploy to GitHub Pages

.cigen/workflows/release/jobs/docker_image.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,14 @@ env:
1010
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
1111
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
1212

13-
steps:
14-
- name: Checkout repository
15-
uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
13+
checkout:
14+
fetch-depth: 0
1815

19-
- id: v
20-
name: Extract version
16+
steps:
17+
- name: Extract version
2118
run: |
2219
VERSION=$(grep -E '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
23-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
20+
echo "DOCKER_IMAGE_VERSION=$VERSION" >> "$GITHUB_ENV"
2421
2522
- name: Set up QEMU
2623
uses: docker/setup-qemu-action@v3
@@ -38,7 +35,7 @@ steps:
3835
name: Build and push multi-arch image
3936
command: |
4037
set -euo pipefail
41-
VERSION="${{ steps.v.outputs.version }}"
38+
VERSION="${{ env.DOCKER_IMAGE_VERSION }}"
4239
echo "Building docspringcom/cigen:${VERSION} and :latest"
4340
docker buildx build \
4441
--platform linux/amd64,linux/arm64 \

.cigen/workflows/release/jobs/release_build.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Dynamic runs-on from matrix
22
image: ${{ matrix.os }}
33

4+
checkout:
5+
fetch-depth: 0
6+
fetch-tags: true
7+
48
strategy:
59
fail-fast: false
610
matrix:
@@ -22,12 +26,6 @@ strategy:
2226
use-cross: true
2327

2428
steps:
25-
- name: Checkout repository
26-
uses: actions/checkout@v4
27-
with:
28-
fetch-depth: 0
29-
fetch-tags: true
30-
3129
- name: Wait for required checks
3230
uses: actions/github-script@v7
3331
with:

0 commit comments

Comments
 (0)