-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init ci * add components to nightly channel * bump h2 to 0.4.4
- Loading branch information
Showing
11 changed files
with
166 additions
and
96 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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
repo_root=$(git rev-parse --show-toplevel) | ||
|
||
# shellcheck disable=SC1091 | ||
source "$repo_root/.github/scripts/rust-version.sh" stable >/dev/null | ||
|
||
cargo +"$rust_stable" audit |
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,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
repo_root=$(git rev-parse --show-toplevel) | ||
|
||
# shellcheck disable=SC1091 | ||
source "$repo_root/.github/scripts/rust-version.sh" nightly >/dev/null | ||
|
||
rustup component add clippy --toolchain="$rust_nightly" | ||
cargo +"$rust_nightly" clippy |
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,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
repo_root=$(git rev-parse --show-toplevel) | ||
|
||
# shellcheck disable=SC1091 | ||
source "$repo_root/.github/scripts/rust-version.sh" nightly >/dev/null | ||
|
||
rustup component add rustfmt --toolchain="$rust_nightly" | ||
cargo +"$rust_nightly" fmt --all |
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 -e | ||
|
||
repo_root=$(git rev-parse --show-toplevel) | ||
|
||
# shellcheck disable=SC1091 | ||
source "$repo_root/.github/scripts/rust-version.sh" stable >/dev/null | ||
|
||
cargo +"$rust_stable" test |
2 changes: 1 addition & 1 deletion
2
scripts/read-cargo-variable.sh → .github/scripts/read-cargo-variable.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# source this file | ||
#!/usr/bin/env bash | ||
|
||
readCargoVariable() { | ||
declare variable="$1" | ||
|
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,68 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This file maintains the rust versions for use by CI. | ||
# | ||
# Obtain the environment variables without any automatic toolchain updating: | ||
# $ source <path>/rust-version.sh | ||
# | ||
# Obtain the environment variables updating both stable and nightly, only stable, or | ||
# only nightly: | ||
# $ source <path>/rust-version.sh all | ||
# $ source <path>/rust-version.sh stable | ||
# $ source <path>/rust-version.sh nightly | ||
|
||
# Then to build with either stable or nightly: | ||
# $ cargo +"$rust_stable" build | ||
# $ cargo +"$rust_nightly" build | ||
|
||
repo_root=$(git rev-parse --show-toplevel) | ||
|
||
# stable version | ||
if [[ -n $RUST_STABLE_VERSION ]]; then | ||
stable_version="$RUST_STABLE_VERSION" | ||
else | ||
# shellcheck disable=SC1090,SC1091 | ||
source "$repo_root/.github/scripts/read-cargo-variable.sh" | ||
stable_version=$(readCargoVariable channel "$repo_root/rust-toolchain.toml") | ||
fi | ||
|
||
# nightly version | ||
if [[ -n $RUST_NIGHTLY_VERSION ]]; then | ||
nightly_version="$RUST_NIGHTLY_VERSION" | ||
else | ||
nightly_version=2024-01-05 | ||
fi | ||
|
||
export rust_stable="$stable_version" | ||
export rust_nightly=nightly-"$nightly_version" | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "Usage: $0 [all|stable|nightly]" | ||
exit 1 | ||
fi | ||
|
||
case $1 in | ||
all) | ||
toolchains=("$rust_stable" "$rust_nightly") | ||
;; | ||
stable) | ||
toolchains=("$rust_stable") | ||
;; | ||
nightly) | ||
toolchains=("$rust_nightly") | ||
;; | ||
*) | ||
echo "Usage: $0 [all|stable|nightly]" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
for toolchain in "${toolchains[@]}"; do | ||
if ! cargo +"$toolchain" -V >/dev/null; then | ||
echo "$0: installing $toolchain" | ||
rustup install "$toolchain" | ||
cargo +"$toolchain" -V | ||
else | ||
echo "$0: $toolchain has already installed." | ||
fi | ||
done |
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,26 @@ | ||
name: Audit | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- .github/** | ||
- "**/Cargo.toml" | ||
- "**/Cargo.lock" | ||
schedule: | ||
- cron: "0 4 * * *" | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Audit" | ||
run: | | ||
.github/scripts/cargo-audit.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,27 @@ | ||
name: Rust | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Fmt" | ||
run: | | ||
.github/scripts/cargo-fmt.sh | ||
- name: "Clippy" | ||
run: | | ||
.github/scripts/cargo-clippy.sh | ||
- name: "Test" | ||
run: | | ||
.github/scripts/cargo-test.sh |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.