Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 0 additions & 77 deletions .github/actions/ci-setup/action.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/actions/setup-sccache/action.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/scripts/nix-post-build-hook.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .github/scripts/nix-shell.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

shell="${NIX_SHELL:-default}"
nix develop "${GITHUB_WORKSPACE:-.}#${shell}" --impure --command bash -e "$@"
nix develop "${GITHUB_WORKSPACE:-.}#${shell}" --impure --command "$@"
23 changes: 0 additions & 23 deletions .github/scripts/nix-upload-cache.sh

This file was deleted.

148 changes: 62 additions & 86 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,72 @@ env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
# These are read-only keys for a S3 bucket for sccache caching
S3_ENDPOINT: "6ca7d4e3d5c9496083876496fc36b8b0.r2.cloudflarestorage.com"
S3_BUCKET: "troy-crates-ci"
PUBLIC_S3_ACCESS_KEY: "b93e0986c42bc88d2d85dc087f2a94ba"
PUBLIC_S3_SECRET_KEY: "60bc5cfd8b121d0acb35d829755b587d29fd8da212c5a81fc4df3be0f433282e"

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

jobs:
fmt:
name: Format
test:
name: Test
runs-on: ubuntu-latest
permissions: &read-permissions
contents: read
defaults:
defaults: &defaults
run:
shell: &shell bash -c ". $GITHUB_WORKSPACE/.github/scripts/nix-shell.sh {0}"
shell: ${{ github.workspace }}/.github/scripts/nix-shell.sh bash -e {0}
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Setup environment
uses: ./.github/actions/ci-setup
- &setup-nix
name: Setup environment
uses: troymoder/shared-actions/setup-nix@b114355b5a126b78c9e19920afa01075a32ee39e
with:
shell: *shell
nix_cache_private_key: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
s3_access_key: ${{ secrets.S3_ACCESS_KEY }}
s3_secret_key: ${{ secrets.S3_SECRET_KEY }}
sccache_enabled: "false"
nix_cache_public_key: ${{ vars.NIX_CACHE_PUBLIC_KEY }}
s3_bucket: ${{ vars.S3_CACHE_BUCKET }}
s3_endpoint: ${{ vars.S3_CACHE_ENDPOINT }}
s3_public_url: ${{ vars.S3_CACHE_PUBLIC_URL }}
s3_access_key: ${{ secrets.S3_CACHE_BUCKET_ACCESS_KEY || vars.S3_CACHE_BUCKET_PUBLIC_ACCESS_KEY }}
s3_secret_access_key: ${{ secrets.S3_CACHE_BUCKET_SECRET_ACCESS_KEY || vars.S3_CACHE_BUCKET_PUBLIC_SECRET_ACCESS_KEY }}

- &setup-sccache
name: Setup sccache
uses: troymoder/shared-actions/setup-sccache@b114355b5a126b78c9e19920afa01075a32ee39e
with:
s3_bucket: ${{ vars.S3_CACHE_BUCKET }}
s3_endpoint: ${{ vars.S3_CACHE_ENDPOINT }}
sccache_command: ${{ github.workspace }}/.github/scripts/nix-shell.sh sccache

- name: Run tests
run: just test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
uses: codecov/codecov-action@v5
with:
files: target/nextest/**/junit.xml
report_type: test_results
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

fmt:
name: Format
runs-on: ubuntu-latest
permissions: *read-permissions
defaults: *defaults
steps:
- name: Checkout repository
uses: actions/checkout@v5

- *setup-nix

- name: Check formatting
run: just fmt
Expand All @@ -52,21 +87,14 @@ jobs:
name: Sync README
runs-on: ubuntu-latest
permissions: *read-permissions
defaults:
run:
shell: *shell
defaults: *defaults
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Setup environment
uses: ./.github/actions/ci-setup
with:
shell: *shell
nix_cache_private_key: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
s3_access_key: ${{ secrets.S3_ACCESS_KEY }}
s3_secret_key: ${{ secrets.S3_SECRET_KEY }}
sccache_enabled: "true"
- *setup-nix

- *setup-sccache

- name: Sync README
run: just sync-readme-test
Expand All @@ -75,82 +103,30 @@ jobs:
name: Clippy
runs-on: ubuntu-latest
permissions: *read-permissions
defaults:
run:
shell: *shell
defaults: *defaults
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Setup environment
uses: ./.github/actions/ci-setup
with:
shell: *shell
nix_cache_private_key: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
s3_access_key: ${{ secrets.S3_ACCESS_KEY }}
s3_secret_key: ${{ secrets.S3_SECRET_KEY }}
sccache_enabled: "true"
- *setup-nix

- *setup-sccache

- name: Run clippy
run: cargo clippy --all-targets --all-features

test:
name: Test
runs-on: ubuntu-latest
permissions: *read-permissions
defaults:
run:
shell: *shell
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Setup environment
uses: ./.github/actions/ci-setup
with:
shell: *shell
nix_cache_private_key: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
s3_access_key: ${{ secrets.S3_ACCESS_KEY }}
s3_secret_key: ${{ secrets.S3_SECRET_KEY }}
sccache_enabled: "true"

- name: Run tests
run: just test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
uses: codecov/codecov-action@v5
with:
files: target/nextest/**/junit.xml
report_type: test_results
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

doc:
name: Documentation
runs-on: ubuntu-latest
permissions: *read-permissions
defaults:
run:
shell: *shell
defaults: *defaults
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Setup environment
uses: ./.github/actions/ci-setup
with:
shell: *shell
nix_cache_private_key: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
s3_access_key: ${{ secrets.S3_ACCESS_KEY }}
s3_secret_key: ${{ secrets.S3_SECRET_KEY }}
sccache_enabled: "true"
- *setup-nix

- *setup-sccache

- name: Check documentation
run: just doc
Expand Down
Loading