Skip to content

Commit 961da8a

Browse files
committed
Initial commit
0 parents  commit 961da8a

Some content is hidden

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

64 files changed

+14496
-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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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 }}
15+
path: |
16+
~/.cargo/registry/index/
17+
~/.cargo/registry/cache/
18+
~/.cargo/git/db/
19+
- uses: actions/cache@v4
20+
name: Cache Cargo target
21+
id: cache-cargo-target
22+
with:
23+
key: cargo-target-${{ inputs.cache-name }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Cargo.lock') }}
24+
restore-keys: |
25+
cargo-target-${{ inputs.cache-name }}-${{ runner.os }}-${{ runner.arch }}-
26+
path: |
27+
target/**
28+
- name: Set cache hit output
29+
shell: bash
30+
run: |
31+
echo "target-cache-hit=${{ steps.cache-cargo-target.outputs.cache-hit }}" >> $GITHUB_OUTPUT
32+
echo "registry-cache-hit=${{ steps.cache-cargo-registry.outputs.cache-hit }}" >> $GITHUB_OUTPUT

.github/workflows/build.yaml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Check, test, clippy
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+
20+
jobs:
21+
check:
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
matrix:
25+
os: [ubuntu-latest, macos-latest]
26+
steps:
27+
- uses: actions/checkout@v4
28+
- run: rustup update
29+
- uses: ./.github/actions/rust-cache
30+
with:
31+
cache-name: check
32+
- run: cargo check --all-targets
33+
test:
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
matrix:
37+
os: [ubuntu-latest, macos-latest]
38+
steps:
39+
- uses: actions/checkout@v4
40+
- run: rustup update
41+
- uses: ./.github/actions/rust-cache
42+
with:
43+
cache-name: test
44+
- name: Install cargo-binstall
45+
uses: cargo-bins/cargo-binstall@main
46+
- name: Install cargo-nextest
47+
run: cargo binstall --no-confirm cargo-nextest
48+
- run: cargo nextest run --profile ci --cargo-profile ci
49+
clippy:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
- run: rustup update
54+
- uses: ./.github/actions/rust-cache
55+
with:
56+
cache-name: clippy
57+
- run: cargo clippy --all-targets -- -D warnings
58+
fmt:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
- run: rustup toolchain install nightly
63+
- run: cargo +nightly fmt --check
64+
deny:
65+
runs-on: ubuntu-latest
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Install cargo-binstall
69+
uses: cargo-bins/cargo-binstall@main
70+
- name: Install cargo-deny
71+
run: cargo binstall --no-confirm cargo-deny
72+
- run: cargo deny check
73+
audit:
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/checkout@v4
77+
- name: Install cargo-binstall
78+
uses: cargo-bins/cargo-binstall@main
79+
- name: Install cargo-audit
80+
run: cargo binstall --no-confirm cargo-audit
81+
- run: cargo audit
82+
# cross-build:
83+
# runs-on: ${{ matrix.target.runner }}
84+
# strategy:
85+
# matrix:
86+
# target:
87+
# - { arch: x86_64-linux, runner: ubuntu-latest }
88+
# - { arch: aarch64-linux, runner: ubuntu-latest }
89+
# - { arch: aarch64-darwin, runner: macos-latest }
90+
# - { arch: x86_64-darwin, runner: macos-latest }
91+
# steps:
92+
# - uses: actions/checkout@v4
93+
# - name: Install nix
94+
# uses: nixbuild/nix-quick-install-action@v32
95+
# - uses: ./.github/actions/rust-cache
96+
# with:
97+
# cache-name: cross-build
98+
# - name: Determine rust target
99+
# id: rust-target
100+
# run: |
101+
# case "${{ matrix.target.arch }}" in
102+
# "x86_64-linux")
103+
# echo "rust_target=x86_64-unknown-linux-musl" >> $GITHUB_OUTPUT
104+
# ;;
105+
# "aarch64-linux")
106+
# echo "rust_target=aarch64-unknown-linux-musl" >> $GITHUB_OUTPUT
107+
# ;;
108+
# "x86_64-darwin")
109+
# echo "rust_target=x86_64-apple-darwin" >> $GITHUB_OUTPUT
110+
# ;;
111+
# "aarch64-darwin")
112+
# echo "rust_target=aarch64-apple-darwin" >> $GITHUB_OUTPUT
113+
# ;;
114+
# esac
115+
# - name: Build binary
116+
# run: |
117+
# nix develop .#crossBuildShell-${{ matrix.target.arch }} -c \
118+
# cargo build --locked --release

.gitignore

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

0 commit comments

Comments
 (0)