-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a41a6b5
Showing
15 changed files
with
823 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[alias] | ||
docs = "doc --workspace --all-features --no-deps" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
[advisories] | ||
vulnerability = "deny" | ||
unmaintained = "warn" | ||
unsound = "warn" | ||
yanked = "warn" | ||
notice = "warn" | ||
|
||
[bans] | ||
multiple-versions = "warn" | ||
wildcards = "deny" | ||
highlight = "all" | ||
|
||
[licenses] | ||
unlicensed = "deny" | ||
confidence-threshold = 0.9 | ||
# copyleft = "deny" | ||
|
||
allow = [ | ||
"MIT", | ||
"MIT-0", | ||
"Apache-2.0", | ||
"Apache-2.0 WITH LLVM-exception", | ||
"BSD-2-Clause", | ||
"BSD-3-Clause", | ||
"ISC", | ||
"Unicode-DFS-2016", | ||
"Unlicense", | ||
"MPL-2.0", | ||
# https://github.com/briansmith/ring/issues/902 | ||
"LicenseRef-ring", | ||
# https://github.com/briansmith/webpki/issues/148 | ||
"LicenseRef-webpki", | ||
] | ||
|
||
exceptions = [ | ||
# CC0 is a permissive license but somewhat unclear status for source code | ||
# so we prefer to not have dependencies using it | ||
# https://tldrlegal.com/license/creative-commons-cc0-1.0-universal | ||
{ allow = ["CC0-1.0"], name = "tiny-keccak" }, | ||
] | ||
|
||
[[licenses.clarify]] | ||
name = "ring" | ||
expression = "LicenseRef-ring" | ||
license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }] | ||
|
||
[[licenses.clarify]] | ||
name = "webpki" | ||
expression = "LicenseRef-webpki" | ||
license-files = [{ path = "LICENSE", hash = 0x001c7e6c }] | ||
|
||
[sources] | ||
unknown-registry = "deny" | ||
unknown-git = "deny" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Runs `cargo update` periodically. | ||
|
||
name: Update Dependencies | ||
|
||
on: | ||
schedule: | ||
# Run weekly | ||
- cron: "0 0 * * SUN" | ||
workflow_dispatch: | ||
# Needed so we can run it manually | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: cargo-update | ||
TITLE: "chore(deps): weekly `cargo update`" | ||
BODY: | | ||
Automation to keep dependencies in `Cargo.lock` current. | ||
<details><summary><strong>cargo update log</strong></summary> | ||
<p> | ||
```log | ||
$cargo_update_log | ||
``` | ||
</p> | ||
</details> | ||
jobs: | ||
update: | ||
name: Update | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
|
||
- name: cargo update | ||
# Remove first line that always just says "Updating crates.io index" | ||
run: cargo update --color never 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log | ||
|
||
- name: craft commit message and PR body | ||
id: msg | ||
run: | | ||
export cargo_update_log="$(cat cargo_update.log)" | ||
echo "commit_message<<EOF" >> $GITHUB_OUTPUT | ||
printf "$TITLE\n\n$cargo_update_log\n" >> $GITHUB_OUTPUT | ||
echo "EOF" >> $GITHUB_OUTPUT | ||
echo "body<<EOF" >> $GITHUB_OUTPUT | ||
echo "$BODY" | envsubst >> $GITHUB_OUTPUT | ||
echo "EOF" >> $GITHUB_OUTPUT | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
add-paths: ./Cargo.lock | ||
commit-message: ${{ steps.msg.outputs.commit_message }} | ||
title: ${{ env.TITLE }} | ||
body: ${{ steps.msg.outputs.body }} | ||
branch: ${{ env.BRANCH }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Runs integration tests. | ||
|
||
name: integration | ||
|
||
on: | ||
pull_request: | ||
merge_group: | ||
push: | ||
branches: [main] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: test | ||
env: | ||
RUST_BACKTRACE: 1 | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: taiki-e/install-action@nextest | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- name: Check bytecode is up to date with source | ||
run: | | ||
make check-bytecode | ||
- name: Run tests | ||
run: | | ||
cargo nextest run \ | ||
--locked \ | ||
--workspace \ | ||
-E 'kind(test)' | ||
integration-success: | ||
name: integration success | ||
runs-on: ubuntu-latest | ||
if: always() | ||
needs: [test] | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Lint GitHub Actions workflows | ||
on: | ||
pull_request: | ||
paths: | ||
- '.github/**' | ||
merge_group: | ||
push: | ||
paths: | ||
- '.github/**' | ||
|
||
jobs: | ||
actionlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download actionlint | ||
id: get_actionlint | ||
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) | ||
shell: bash | ||
- name: Check workflow files | ||
run: SHELLCHECK_OPTS="-S error" ${{ steps.get_actionlint.outputs.executable }} -color | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: lint | ||
|
||
on: | ||
pull_request: | ||
merge_group: | ||
push: | ||
branches: [main] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
# clippy-binaries: | ||
# name: clippy | ||
# runs-on: ubuntu-latest | ||
# timeout-minutes: 30 | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: dtolnay/rust-toolchain@clippy | ||
# - uses: Swatinem/rust-cache@v2 | ||
# with: | ||
# cache-on-failure: true | ||
# - run: | ||
# cargo clippy --bin BINARY --workspace | ||
# env: | ||
# RUSTFLAGS: -D warnings | ||
|
||
clippy: | ||
name: clippy | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@clippy | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- run: cargo clippy --workspace --examples --tests --benches --all-features | ||
env: | ||
RUSTFLAGS: -D warnings | ||
|
||
crate-checks: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: taiki-e/install-action@cargo-hack | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- run: cargo hack check | ||
|
||
msrv: | ||
name: MSRV | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: "1.80" # MSRV | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
# update when a binary exists | ||
# - run: cargo build --bin BINARY --workspace | ||
- run: cargo build --workspace | ||
env: | ||
RUSTFLAGS: -D warnings | ||
|
||
docs: | ||
name: docs | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- run: cargo docs --document-private-items | ||
env: | ||
# Note below only applies for when we have a book.yml | ||
# Keep in sync with ./book.yml:jobs.build | ||
# This should only add `-D warnings` | ||
RUSTDOCFLAGS: | ||
--cfg docsrs --show-type-layout --generate-link-to-definition --enable-index-page | ||
-Zunstable-options -D warnings | ||
|
||
fmt: | ||
name: fmt | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt | ||
- run: cargo fmt --all --check | ||
|
||
lint-success: | ||
name: lint success | ||
runs-on: ubuntu-latest | ||
if: always() | ||
# re-add when a binary exists | ||
# needs: [clippy-binaries, clippy, crate-checks, docs, fmt] | ||
needs: [clippy, crate-checks, docs, fmt] | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Runs unit tests. | ||
|
||
name: unit | ||
|
||
on: | ||
pull_request: | ||
merge_group: | ||
push: | ||
branches: [main] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: test | ||
env: | ||
RUST_BACKTRACE: 1 | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- uses: taiki-e/install-action@nextest | ||
- name: Run tests | ||
run: | | ||
cargo nextest run \ | ||
--locked \ | ||
--workspace \ | ||
-E "kind(lib) | kind(bin) | kind(proc-macro)" | ||
doc: | ||
name: doc tests | ||
env: | ||
RUST_BACKTRACE: 1 | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- name: Run doctests | ||
run: cargo test --doc --workspace | ||
|
||
unit-success: | ||
name: unit success | ||
runs-on: ubuntu-latest | ||
if: always() | ||
needs: [test] | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} |
Oops, something went wrong.