Skip to content

Commit bc097a5

Browse files
committed
Initial commit
0 parents  commit bc097a5

Some content is hidden

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

66 files changed

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

.gitignore

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

.taplo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[formatting]
2+
align_comments = true
3+
align_entries = true
4+
allowed_blank_lines = 2
5+
reorder_keys = true
6+
trailing_newlines = false

0 commit comments

Comments
 (0)