-
Notifications
You must be signed in to change notification settings - Fork 9
GitHub action to check Rust stable version against Rust installed in latest docker container #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Problem Rust releases a new version approximatly every six weeks. We need to detect a new release Solution * install the current stable toolchain * extract the version of the stable toolchain from rustup check * extract the version of the installed toolchain from rustup default * compare and return an error if they do not match Note Docker containers are built with a specific version (not stable).
Problem Script to check must be installed in the build Solution * Add the latest.sh script to container Note
Problem Exceute the latest.sh script Solution * make command to run the latest.sh script entrypoint Note
Problem Version check should be executed routinely Solution * Use scheduled github action to run check * Load unix and checkout source * Make check to run script Note * docker on host will download latest conainer
FIX: missing colon on cron
FIX: yaml error
added checkout
checkout version2
FIX: ID created new step
Use different create issue action
zamazan4ik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I've thought about such automation in repo but didn't know that it's possible with GitHub Actions.
Please fix small cosmetic issues and I will merge this PR.
Sorry for delay - I didn't get a notification about this PR. Next time please explicitly request review from me - in this way I will definitely get a notification.
.github/workflows/check.yml
Outdated
| steps: | ||
| - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" --label "enhancement" -R $GITHUB_REPOSITORY | ||
| env: | ||
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a newline
.gitignore
Outdated
| tests/test-*/test-out.log | ||
| target | ||
| .DS_Store | ||
| .vscode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a newline
latest.sh
Outdated
|
|
||
| if [ "${STABLE}" == "${DEFAULT}" ]; then exit 0 | ||
| else exit 1 | ||
| fi No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a newline
Makefile
Outdated
| check: | ||
| $(DOCKER) run --rm \ | ||
| --entrypoint=/usr/local/bin/latest.sh \ | ||
| $(REPO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a newline
Objective
Periodically check the version of Rust in the latest docker container against the current Rust Stable channel version and create an issue if they do not match.
Components
The following components are added/changed:
check.yml
The GitHub Action action runs two jobs: check and create_issue. The action is scheduled to trigger each Tuesday morning at 0400Z. The action can also be triggered using a workflow_dispatch event.
check
Runs make check run the latest.sh script installed in the latest docker container.
create_issue
Runs if the check job fails to create an issue in the issue log.
Makefile
Adds a new task to run the latest docker container using the latest.sh as the entrypoint (instead of the default build.sh entrypoint).
latest.sh
Installs the Rust stable channel on the container.
Uses rustup check to extract the version number of the stable container.
Uses rustup show to extract the version number of the default toolchain (initially installed in the container).
Compares and exits with an error if they do not match.
Dockerfile
Adds latest.sh to the build