-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pin CI fuzzing job nightly versions and add CI job to update them bi-…
…weekly (#1202) * use pinned nightly release in fuzzing CI jobs * add CI job to update nightly fuzz version every 2 weeks * add some docs and comments * try to use nightly from 3 days ago * try out less recent pinned nightly * properly use toolchain field * update script to reflect changes * use normal tagged nightly release in updater CI workflow * add comments about nightly pinning
- Loading branch information
Showing
2 changed files
with
56 additions
and
3 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
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,44 @@ | ||
# GitHub Actions CI job to update the Rust toolchain nightly versions used in `rust.yml` every 2 weeks. | ||
# | ||
# Note: This particularly affects the fuzzing CI jobs that have to pin a nightly | ||
# release in order to not invalidate their caches on a daily basis. | ||
|
||
name: Update Rust Nightly Version | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 */14 * *' # Every 2 weeks | ||
workflow_dispatch: # Allows to trigger this CI job via GitHub UI | ||
|
||
jobs: | ||
update-nightly: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install the latest Rust nightly | ||
uses: dtolnay/rust-toolchain@nightly | ||
|
||
- name: Get the latest Rust nightly version | ||
run: | | ||
# Fetch the Rust version, e.g., rustc 1.81.0-nightly (eeb90cda1 2024-09-04) | ||
RUSTC_VERSION=$(rustc --version) | ||
echo "Rustc Version: $RUSTC_VERSION" | ||
# Extract the nightly version date (2024-09-04) | ||
LATEST_NIGHTLY=$(echo $RUSTC_VERSION | grep -Po '\d{4}-\d{2}-\d{2}') | ||
echo "LATEST_NIGHTLY=$LATEST_NIGHTLY" >> $GITHUB_ENV | ||
- name: Update nightly version in CI workflow | ||
run: | | ||
FILE=".github/workflows/rust.yml" | ||
sed -i "s/toolchain: nightly-[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/toolchain: nightly-$LATEST_NIGHTLY/" $FILE | ||
- name: Commit and push changes | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add .github/workflows/rust.yml | ||
git commit -m "Update Rust nightly version to $LATEST_NIGHTLY" | ||
git push |