Skip to content

Commit f8681c2

Browse files
build: converting from Docker -> Nix (#399)
* build: converting from Docker -> Nix * ci: project specific dogfooding
1 parent 674b09e commit f8681c2

32 files changed

+321
-186
lines changed

.cargo/config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ rustflags = [
1212
"-C", "target-feature=+crt-static",
1313
"-C", "link-self-contained=yes",
1414
]
15+
16+
[target.aarch64-unknown-linux-musl]
17+
rustflags = [
18+
"-C", "target-feature=+crt-static",
19+
"-C", "link-self-contained=yes",
20+
]

.copier-answers.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Changes here will be overwritten by Copier
2+
_commit: v1.4.7
3+
_src_path: https://github.com/DeveloperC286/template
4+
project_name: clean_git_history

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.github/renovate.json5

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,18 @@
44
"config:best-practices"
55
],
66
"automerge": true,
7-
"dockerfile": {
8-
"managerFilePatterns": [
9-
"/(^|/|\\.)Dockerfile$/",
10-
"/(^|/)Dockerfile[^/]*$/"
11-
]
7+
"github-actions": {
8+
"enabled": false
9+
},
10+
"nix": {
11+
"enabled": true,
12+
"lockFileMaintenance": {
13+
"enabled": true,
14+
"commitMessageAction": "update",
15+
"commitMessageTopic": "Nix flake lock"
16+
}
1217
},
1318
"customManagers": [
14-
{
15-
"customType": "regex",
16-
"managerFilePatterns": [
17-
"/(^|/|\\.)Dockerfile$/",
18-
"/(^|/)Dockerfile[^/]*$/"
19-
],
20-
"matchStrings": [
21-
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s.+_VERSION=\"(?<currentValue>.*?)\"\\s"
22-
]
23-
},
2419
{
2520
"customType": "regex",
2621
"managerFilePatterns": [
@@ -36,18 +31,6 @@
3631
"datasourceTemplate": "repology",
3732
"depNameTemplate": "alpine_{{alpineMajor}}_{{alpineMinor}}/{{name}}",
3833
"versioningTemplate": "loose"
39-
},
40-
{
41-
"customType": "regex",
42-
"managerFilePatterns": [
43-
"/(^|/|\\.)Makefile$/",
44-
"/(^|/)Makefile[^/]*$/"
45-
],
46-
"matchStrings": [
47-
"# renovate: depName=(?<depName>.*?)\\s.+_VERSION=(?<currentValue>[a-z0-9.-]+)(?:@(?<currentDigest>sha256:[a-f0-9]+))?"
48-
],
49-
"datasourceTemplate": "docker",
50-
"versioningTemplate": "docker"
5134
}
5235
]
5336
}

.github/workflows/claude-code-agent.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ jobs:
2727
actions: read # Required for Claude to read CI results on PRs
2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
30+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3131
with:
3232
fetch-depth: 1
3333

3434
- name: Run Claude Code
3535
id: claude
36-
uses: anthropics/claude-code-action@f0c8eb29807907de7f5412d04afceb5e24817127 # v1
36+
uses: anthropics/claude-code-action@f0c8eb29807907de7f5412d04afceb5e24817127 # v1.0.23
3737
with:
3838
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
3939

.github/workflows/claude-code-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ jobs:
1818

1919
steps:
2020
- name: Checkout repository
21-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
21+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2222
with:
2323
fetch-depth: 1
2424

2525
- name: Run Claude Code Review
2626
id: claude-review
27-
uses: anthropics/claude-code-action@f0c8eb29807907de7f5412d04afceb5e24817127 # v1
27+
uses: anthropics/claude-code-action@f0c8eb29807907de7f5412d04afceb5e24817127 # v1.0.23
2828
with:
2929
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
3030
prompt: |

.github/workflows/continuous-delivery.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,49 @@ permissions:
1212
jobs:
1313
publish-binary:
1414
name: Publish Binary
15-
runs-on: ubuntu-latest
15+
runs-on: ${{ matrix.architecture }}
16+
strategy:
17+
matrix:
18+
architecture: [ubuntu-24.04, ubuntu-24.04-arm]
1619
steps:
1720
- name: Checkout code.
1821
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
22+
- name: Setup Nix.
23+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
1924
- name: Publish binary.
20-
run: make publish-binary RELEASE="${GITHUB_REF_NAME}"
25+
run: nix develop -c make publish-binary RELEASE="${GITHUB_REF_NAME}"
2126
env:
2227
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by GitHub Actions.
2328

2429
publish-crate:
2530
name: Publish Crate
26-
runs-on: ubuntu-latest
31+
runs-on: ubuntu-24.04
2732
steps:
2833
- name: Checkout code.
2934
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
35+
- name: Setup Nix.
36+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
3037
- name: Publish crate.
31-
run: make publish-crate
38+
run: nix develop -c make publish-crate
3239
env:
3340
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
3441

3542
publish-docker:
3643
name: Publish Docker Image
37-
runs-on: ubuntu-latest
44+
runs-on: ubuntu-24.04
45+
needs: [publish-binary]
3846
steps:
3947
- name: Checkout code.
4048
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4149
- name: Set up Docker Buildx
42-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
50+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
4351
- name: Login to GitHub Container Registry
44-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
52+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
4553
with:
4654
registry: ghcr.io
4755
username: ${{ github.actor }}
4856
password: ${{ secrets.GITHUB_TOKEN }}
4957
- name: Publish Docker Image
5058
run: make publish-docker RELEASE="${GITHUB_REF_NAME}"
59+
env:
60+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/continuous-integration.yml

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,72 @@ permissions:
88
jobs:
99
formatting:
1010
name: Formatting
11-
runs-on: ubuntu-latest
11+
runs-on: ${{ matrix.architecture }}
1212
strategy:
1313
matrix:
14+
architecture: [ubuntu-24.04, ubuntu-24.04-arm]
1415
language: [rust, shell, python]
1516
steps:
1617
- name: Checkout code.
1718
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
19+
- name: Setup Nix.
20+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
1821
- name: Check formatting.
19-
run: make check-${{ matrix.language }}-formatting
22+
run: nix develop -c make check-${{ matrix.language }}-formatting
23+
2024
linting:
2125
name: Linting
22-
runs-on: ubuntu-latest
26+
runs-on: ${{ matrix.architecture }}
2327
strategy:
2428
matrix:
29+
architecture: [ubuntu-24.04, ubuntu-24.04-arm]
2530
language: [rust]
2631
steps:
2732
- name: Checkout code.
2833
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
34+
- name: Setup Nix.
35+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
2936
- name: Check linting.
30-
run: make check-${{ matrix.language }}-linting
37+
run: nix develop -c make check-${{ matrix.language }}-linting
38+
3139
compile:
3240
name: Compile
33-
runs-on: ubuntu-latest
41+
runs-on: ${{ matrix.architecture }}
42+
strategy:
43+
matrix:
44+
architecture: [ubuntu-24.04, ubuntu-24.04-arm]
3445
steps:
3546
- name: Checkout code.
3647
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
48+
- name: Setup Nix.
49+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
3750
- name: Compile.
38-
run: make compile
51+
run: nix develop -c make compile
52+
3953
unit-test:
4054
name: Unit Test
41-
runs-on: ubuntu-latest
55+
runs-on: ${{ matrix.architecture }}
56+
strategy:
57+
matrix:
58+
architecture: [ubuntu-24.04, ubuntu-24.04-arm]
4259
steps:
4360
- name: Checkout code.
4461
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
62+
- name: Setup Nix.
63+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
4564
- name: Unit test.
46-
run: make unit-test
65+
run: nix develop -c make unit-test
66+
4767
end-to-end-test:
4868
name: End to End Test
49-
runs-on: ubuntu-latest
69+
runs-on: ${{ matrix.architecture }}
70+
strategy:
71+
matrix:
72+
architecture: [ubuntu-24.04, ubuntu-24.04-arm]
5073
steps:
5174
- name: Checkout code.
5275
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
76+
- name: Setup Nix.
77+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
5378
- name: End to End test.
54-
run: make end-to-end-test
79+
run: nix develop -c make end-to-end-test

.github/workflows/conventional-commits.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ permissions:
88
jobs:
99
linting:
1010
name: Linting
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04
12+
container:
13+
image: ghcr.io/developerc286/conventional_commits_linter:0.17.0@sha256:d6fb0dfd79c2e06897692bc3f0dc62bcb7ce90a92030c81a3137935516d525d7
1214
steps:
1315
- name: Checkout code.
1416
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1517
with:
1618
ref: ${{ github.event.pull_request.head.sha }}
1719
fetch-depth: 0
1820
- name: Check Conventional Commits linting.
19-
run: make check-conventional-commits-linting FROM="origin/${{ github.base_ref }}"
21+
run: conventional_commits_linter --type angular "origin/${{ github.base_ref }}"

.github/workflows/dogfood.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ permissions:
88
jobs:
99
docker:
1010
name: Docker
11-
runs-on: ubuntu-latest
11+
runs-on: ${{ matrix.architecture }}
12+
strategy:
13+
matrix:
14+
architecture: [ubuntu-24.04, ubuntu-24.04-arm]
1215
steps:
1316
- name: Checkout code.
1417
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1518
with:
1619
ref: ${{ github.event.pull_request.head.sha }}
1720
fetch-depth: 0
18-
- name: Dogfooding Docker
19-
run: make dogfood-docker FROM="origin/${{ github.base_ref }}"
21+
- name: Setup Nix.
22+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
23+
- name: Dogfooding Docker.
24+
run: nix develop -c make dogfood-docker FROM="origin/${{ github.base_ref }}"

0 commit comments

Comments
 (0)