Skip to content

Commit

Permalink
Initial commit (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdygert-spok authored Jan 24, 2025
1 parent 56e5f60 commit 9175ca5
Show file tree
Hide file tree
Showing 36 changed files with 1,416 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[Cargo.toml]
indent_style = tab

[*.go]
indent_style = tab

[*.yml]
indent_size = 2
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* @elagergren-spideroak @jdygert-spok

/canaries @jdygert-spok @elagergren-spideroak

/.github @elagergren-spideroak @gknopf-aranya @jdygert-spok
30 changes: 30 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Setup build tools"
description: "Action for setting up build tools"

runs:
using: "composite"
steps:
- name: Version info
shell: bash
run: |
cargo --version --verbose
ldd --version
clang --version
gcc --version
cmake --version
- name: Install sccache
uses: aranya-project/sccache-action@main
with:
version: "v0.8.2"

- name: Configure sccache
shell: bash
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
- name: Install cargo-make
shell: bash
run: cargo install --version '0.37.23' --locked cargo-make
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Build"

on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
workflow_call:
inputs:
workflow:
required: true
type: string

env:
REV: ${{ github.run_id }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.workflow }}
cancel-in-progress: true

jobs:
build-release:
strategy:
matrix:
runner:
- ubuntu-latest
- ubuntu2404-arm64-4core
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup

- name: Build code
run: cargo make build-code

- name: Verify build didn't change any checked-in files
run: cargo make git-unchanged
77 changes: 77 additions & 0 deletions .github/workflows/correctness.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: "Correctness checks and linting"

on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
workflow_call:
inputs:
workflow:
required: true
type: string

env:
REV: ${{ github.run_id }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.workflow }}
cancel-in-progress: true

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup

- name: Check formatting
run: cargo make check-fmt

canaries:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup

- name: Check canaries (no-std/no-alloc)
run: cargo make check-canaries

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup

- name: Run clippy
run: cargo make clippy

machete:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup

- name: Check dependency usage
run: cargo make machete

check:
strategy:
matrix:
runner:
- ubuntu-latest
- ubuntu2404-arm64-4core
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup

- name: Check Features
run: cargo make check-features
42 changes: 42 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Generate Docs"

on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
workflow_call:
inputs:
workflow:
required: true
type: string

env:
REV: ${{ github.run_id }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.workflow }}
cancel-in-progress: true

jobs:
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup

- name: Generate docs
env:
RUSTDOCFLAGS: "-Dwarnings"
run: |
cargo make gen-docs-nightly
cargo make zip-docs
- name: Publish docs
uses: actions/upload-artifact@v4
with:
name: docs
path: docs.zip
if-no-files-found: error
34 changes: 34 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Workflow for automating Rust crate publishing and release PRs.
# repo:
# https://github.com/release-plz/release-plz
# quickstart:
# https://release-plz.dev/docs/github/quickstart
name: Release-plz

permissions:
pull-requests: write
contents: write

on:
push:
branches:
- main

jobs:
# Release unpublished packages.
release-plz-release:
name: Release-plz release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Run release-plz
uses: aranya-project/release-plz-action@main
with:
command: release
env:
GITHUB_TOKEN: ${{ github.token }}
CARGO_REGISTRY_TOKEN: ${{ secrets.ARANYA_BOT_CRATESIO_CARGO_LOGIN_KEY }}
31 changes: 31 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Security Checks"

on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
workflow_call:
inputs:
workflow:
required: true
type: string

env:
REV: ${{ github.run_id }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.workflow }}
cancel-in-progress: true

jobs:
security-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup

- name: Run cargo security checks
run: cargo make security
37 changes: 37 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Unit tests"

on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
workflow_call:
inputs:
workflow:
required: true
type: string

env:
REV: ${{ github.run_id }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.workflow }}
cancel-in-progress: true

jobs:
unit-tests:
strategy:
matrix:
runner:
- ubuntu-latest
- ubuntu2404-arm64-4core
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup

- name: Unit Tests
run: cargo make unit-tests
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# These are backup files generated by rustfmt
**/*.rs.bk

# Apple
.DS_Store

# Added by cargo
# will have compiled files and executables
/target

.ignore/

# From -C instrument-coverage
*.profraw
tarpaulin-report.html

rustc-ice*
30 changes: 30 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9175ca5

Please sign in to comment.