Skip to content

Commit 476087f

Browse files
committed
Initial commit
0 parents  commit 476087f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+15092
-0
lines changed

.config/nextest.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[profile.default]
2+
# Terminate slow tests after 90s (3 periods of 30s)
3+
slow-timeout = { period = "30s", terminate-after = 3 }
4+
5+
[profile.ci]
6+
# Terminate slow tests after 90s (3 periods of 30s)
7+
slow-timeout = { period = "30s", terminate-after = 3 }
8+
# Don't fail fast on CI, so we can see all the test failures.
9+
fail-fast = false
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: cargo-binstall
2+
description: Use cargo-binstall to install cargo binaries
3+
inputs:
4+
binaries:
5+
description: The binaries to install
6+
required: false
7+
runs:
8+
using: composite
9+
steps:
10+
- name: Hash binaries
11+
id: hash-binaries
12+
shell: bash
13+
run: |
14+
if command -v sha256sum >/dev/null 2>&1; then
15+
hash=$(echo "${{ inputs.binaries }}" | sha256sum | awk '{print $1}')
16+
else
17+
hash=$(echo "${{ inputs.binaries }}" | shasum -a 256 | awk '{print $1}')
18+
fi
19+
echo "binaries-hash=$hash" >> $GITHUB_OUTPUT
20+
- uses: actions/cache@v4
21+
name: Cache Cargo binaries
22+
id: cache-cargo-binaries
23+
with:
24+
key: cargo-binaries-${{ steps.hash-binaries.outputs.binaries-hash }}-${{ runner.os }}-${{ runner.arch }}
25+
path: |
26+
~/.cargo/bin/
27+
- name: Find missing binaries
28+
id: find-missing-binaries
29+
shell: bash
30+
run: |
31+
missing_binaries=()
32+
for binary in ${{ inputs.binaries }}; do
33+
if ! command -v $binary &> /dev/null; then
34+
missing_binaries+=($binary)
35+
fi
36+
done
37+
echo "missing_binaries=${missing_binaries[*]}" >> $GITHUB_OUTPUT
38+
- name: Install cargo-binstall
39+
uses: cargo-bins/cargo-binstall@main
40+
if: steps.find-missing-binaries.outputs.missing_binaries != ''
41+
- name: Install missing binaries
42+
if: steps.find-missing-binaries.outputs.missing_binaries != ''
43+
shell: bash
44+
run: cargo binstall --no-confirm ${{ steps.find-missing-binaries.outputs.missing_binaries }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Cache Rust dependencies
2+
description: Cache Rust dependencies to speed up builds
3+
inputs:
4+
cache-name:
5+
description: The name of the cache to use
6+
required: true
7+
runs:
8+
using: composite
9+
steps:
10+
- uses: actions/cache@v4
11+
name: Cache Cargo registry
12+
id: cache-cargo-registry
13+
with:
14+
key: cargo-registry-${{ inputs.cache-name }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Cargo.lock') }}-${{ github.ref_name }}
15+
restore-keys: |
16+
cargo-registry-${{ inputs.cache-name }}-${{ runner.os }}-${{ runner.arch }}-main
17+
cargo-registry-${{ inputs.cache-name }}-${{ runner.os }}-${{ runner.arch }}-
18+
path: |
19+
~/.cargo/registry/index/
20+
~/.cargo/registry/cache/
21+
~/.cargo/git/db/
22+
- uses: actions/cache@v4
23+
name: Cache Cargo target
24+
id: cache-cargo-target
25+
with:
26+
key: cargo-target-${{ inputs.cache-name }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Cargo.lock') }}-${{ github.ref_name }}
27+
restore-keys: |
28+
cargo-target-${{ inputs.cache-name }}-${{ runner.os }}-${{ runner.arch }}-main
29+
cargo-target-${{ inputs.cache-name }}-${{ runner.os }}-${{ runner.arch }}-
30+
path: |
31+
target/**
32+
- name: Set cache hit output
33+
shell: bash
34+
run: |
35+
echo "target-cache-hit=${{ steps.cache-cargo-target.outputs.cache-hit }}" >> $GITHUB_OUTPUT
36+
echo "registry-cache-hit=${{ steps.cache-cargo-registry.outputs.cache-hit }}" >> $GITHUB_OUTPUT
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Setup R2 Credentials"
2+
description: "Configure R2 credentials for CI"
3+
inputs:
4+
r2-access-key-id:
5+
description: "R2 access key ID"
6+
required: true
7+
r2-secret-access-key:
8+
description: "R2 secret access key"
9+
required: true
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Configure R2 credentials
15+
shell: bash
16+
run: |
17+
echo "AWS_ACCESS_KEY_ID=${{ inputs.r2-access-key-id }}" >> $GITHUB_ENV
18+
echo "AWS_SECRET_ACCESS_KEY=${{ inputs.r2-secret-access-key }}" >> $GITHUB_ENV

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
groups:
8+
actions:
9+
patterns:
10+
- "*"
11+
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"
16+
groups:
17+
actions:
18+
patterns:
19+
- "*"

.github/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
changelog:
2+
categories:
3+
- title: 🏕 Features
4+
labels:
5+
- "*"
6+
exclude:
7+
labels:
8+
- dependencies
9+
- title: 👒 Dependencies
10+
labels:
11+
- dependencies

.github/workflows/build.yaml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Run checks and tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
CARGO_INCREMENTAL: 0
18+
CARGO_TERM_COLOR: always
19+
NIX_SIGNING_PUBLIC_KEY: "ellipsis-labs:eug33YU0s2/K/BgiOtEta1cwNIzERtIybNATLOBsrEA="
20+
NIX_CACHE_URI: "s3://atlas-nix-cache?compression=zstd&parallel-compression=true&endpoint=6a2b885167c20bd5dd1d3bcb4b09760f.r2.cloudflarestorage.com"
21+
22+
jobs:
23+
check:
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
matrix:
27+
os: [ubuntu-latest, macos-latest]
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: ./.github/actions/rust-cache
31+
with:
32+
cache-name: check
33+
- uses: ./.github/actions/cargo-binstall
34+
with:
35+
binaries: cargo-hold
36+
- run: cargo hold voyage
37+
- run: cargo check --locked --all-targets
38+
39+
test:
40+
runs-on: ${{ matrix.os }}
41+
needs: [check]
42+
strategy:
43+
matrix:
44+
os: [ubuntu-latest, macos-latest]
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: ./.github/actions/rust-cache
48+
with:
49+
cache-name: test
50+
- uses: ./.github/actions/cargo-binstall
51+
with:
52+
binaries: cargo-nextest cargo-hold
53+
- run: cargo hold voyage
54+
- run: cargo nextest run --locked --profile ci
55+
56+
doctest:
57+
runs-on: ${{ matrix.os }}
58+
needs: [check]
59+
strategy:
60+
matrix:
61+
os: [ubuntu-latest, macos-latest]
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: ./.github/actions/rust-cache
65+
with:
66+
cache-name: doctest
67+
- uses: ./.github/actions/cargo-binstall
68+
with:
69+
binaries: cargo-hold
70+
- run: cargo hold voyage
71+
- run: cargo test --locked --doc
72+
73+
clippy:
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/checkout@v4
77+
- uses: ./.github/actions/rust-cache
78+
with:
79+
cache-name: clippy
80+
- uses: ./.github/actions/cargo-binstall
81+
with:
82+
binaries: cargo-hold
83+
- run: rustup toolchain install nightly-2025-07-08 --component clippy
84+
- run: cargo hold voyage
85+
- run: cargo +nightly-2025-07-08 clippy --all-targets -- -D warnings
86+
87+
fmt:
88+
runs-on: ubuntu-latest
89+
steps:
90+
- uses: actions/checkout@v4
91+
- run: rustup toolchain install nightly-2025-07-08 --component rustfmt
92+
- run: cargo +nightly-2025-07-08 fmt --check
93+
94+
deny:
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v4
98+
- uses: ./.github/actions/cargo-binstall
99+
with:
100+
binaries: cargo-deny
101+
- run: cargo deny check
102+
103+
audit:
104+
runs-on: ubuntu-latest
105+
steps:
106+
- uses: actions/checkout@v4
107+
- uses: ./.github/actions/cargo-binstall
108+
with:
109+
binaries: cargo-audit
110+
- run: cargo audit
111+
112+
cross-build:
113+
needs: [test, doctest, clippy, fmt, deny, audit]
114+
uses: ./.github/workflows/cross-build.yaml
115+
secrets:
116+
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
117+
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
118+
NIX_SIGNING_KEY: ${{ secrets.NIX_SIGNING_KEY }}
119+
120+
all-checks-passed:
121+
needs: [check, test, doctest, clippy, fmt, deny, audit, cross-build]
122+
runs-on: ubuntu-latest
123+
steps:
124+
- run: echo "All checks passed"

0 commit comments

Comments
 (0)