-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
8 changed files
with
118 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,63 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
report: | ||
needs: | ||
- lint-aux | ||
- rustfmt | ||
- clippy | ||
- build-and-test | ||
if: always() | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Report success | ||
if: "!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')" | ||
run: exit 0 | ||
- name: Report failure | ||
if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')" | ||
run: exit 1 | ||
|
||
lint-aux: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: ./ci/install-lint-deps.sh | ||
- name: Run auxilary lints | ||
run: ./ci/lint-aux.sh | ||
|
||
rustfmt: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
run: ./ci/install-rust.sh stable.txt --profile minimal -c rustfmt | ||
- name: Run rustfmt | ||
run: cargo fmt --all -- --check | ||
|
||
clippy: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
run: ./ci/install-rust.sh stable.txt --profile minimal -c clippy | ||
- name: Run clippy | ||
run: ./ci/clippy.sh | ||
|
||
build-and-test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
include: | ||
- rust-version: msrv.txt | ||
- rust-version: stable.txt | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
run: ./ci/install-rust.sh "${{ matrix.rust-version }}" --profile minimal | ||
- name: Build and test | ||
run: ./ci/build-and-test.sh |
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,10 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
export RUSTDOCFLAGS="-D warnings" | ||
|
||
cargo fetch --locked | ||
|
||
cargo build --workspace --all-targets --frozen | ||
cargo test --workspace --frozen | ||
cargo doc --workspace --frozen |
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,5 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
cargo fetch --locked | ||
cargo clippy --workspace --all-targets --frozen -- -D warnings |
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,7 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends shellcheck | ||
|
||
sudo gem install mdl |
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,13 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
rust_version="$1" | ||
shift | ||
|
||
if [[ "$rust_version" = *.txt ]]; then | ||
rust_version="$(cat "ci/rust-versions/$rust_version")" | ||
fi | ||
|
||
echo "Installing Rust $rust_version" | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain "$rust_version" "$@" | ||
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" |
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,18 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
echo "Checking MSRV consistency" | ||
|
||
msrv="$(cat ci/rust-versions/msrv.txt)" | ||
msrv="${msrv%.*}" | ||
|
||
if [ "$(grep rust-version Cargo.toml)" != "rust-version = \"$msrv\"" ]; then | ||
echo "Incorrect rust-version in Cargo.toml" | ||
exit 1 | ||
fi | ||
|
||
echo "Checking shell scripts with shellcheck" | ||
find . -type f -name "*.sh" -not -path "./.git/*" -print0 | xargs -0 shellcheck | ||
|
||
echo "Checking markdown documents with markdownlint" | ||
find . -type f -name "*.md" -not -path "./.git/*" -print0 | xargs -0 mdl |
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 @@ | ||
1.74.0 |
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 @@ | ||
1.77.0 |