Compare commits

...

10 Commits

Author SHA1 Message Date
Jonas Bushart
c17331ebbf Update changelog for v1.1.0 2022-07-19 19:03:54 +00:00
Jonas Bushart
49e54cc50a Update to newer version of caching action 2022-07-19 19:01:40 +00:00
Jonas Bushart
29a2385140 Better and more verbose version printing and cachekey version. 2022-07-19 19:00:36 +00:00
Jonas Bushart
8ba04cb6f2 Install rustup if not available, Linux only
The original code stems from this PR:
https://github.com/dtolnay/rust-toolchain/pull/8
2022-07-19 18:48:19 +00:00
Jonas Bushart
5c0654516c Create dependabot configuration for GitHub Actions 2022-07-19 20:16:04 +02:00
Jonas Bushart
d39b183d8d Enable backtraces for test failures 2022-05-02 20:41:08 +00:00
Jonas Bushart
4018312e96 Enable colored cargo output 2022-05-02 20:32:16 +00:00
Jonas Bushart
9015641f5c Update changelog 2022-04-20 20:27:13 +00:00
Jonas Bushart
014f31d759 Shrinkt action description to make it marketplace compliant 2022-04-20 20:25:35 +00:00
Jonas Bushart
85cc8bd3df Add changelog 2022-04-20 20:15:26 +00:00
3 changed files with 76 additions and 10 deletions

11
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"

38
CHANGELOG.md Normal file
View File

@@ -0,0 +1,38 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.1.0] - 2022-07-19
### Added
* Install rustup if not available in the CI environment. (Linux only)
The code is taken from this issue: <https://github.com/dtolnay/rust-toolchain/pull/8>
* Add rustc version output suitable as a cache key.
This is based on <https://github.com/dtolnay/rust-toolchain/pull/20> and <https://github.com/dtolnay/rust-toolchain/pull/17>.
### Changed
* Update to `Swatinem/rust-cache@v2`.
## [1.0.2] - 2022-05-02
### Changed
* Enable colored cargo output.
* Print short backtraces during test failure.
## [1.0.1] - 2022-04-20
### Added
* Release action on marketplace
## [1.0.0] - 2022-04-20
Initial Version

View File

@@ -1,8 +1,7 @@
name: Setup Rust Toolchain for GitHub CI
description: |
Setup specific Rust versions and integrate nicely into the ecosystem.
The action enabled caching of Rust tools and build artifacts and sets environment variables for faster and more efficient caching.
It also sets up problem matchers showing compilation and formatting issues.
Setup specific Rust versions with caching pre-configured.
It provides problem matchers for cargo and rustfmt issues.
branding:
icon: "play"
@@ -34,6 +33,9 @@ outputs:
rustup-version:
description: "Version as reported by `rustup --version`"
value: ${{steps.versions.outputs.rustup-version}}
cachekey:
description: A short hash of the rustc version, appropriate for use as a cache key. "20220627a831"
value: ${{steps.versions.outputs.cachekey}}
runs:
using: composite
@@ -48,24 +50,37 @@ runs:
targets: ${{inputs.target}}
components: ${{inputs.components}}
shell: bash
- name: Install rustup, if needed
run: |
if ! command -v rustup &> /dev/null ; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-~/.cargo}/bin" >> $GITHUB_PATH
fi
if: runner.os != 'Windows'
shell: bash
- name: rustup toolchain install ${{inputs.toolchain}}
run: |
rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update
rustup default ${{inputs.toolchain}}
shell: bash
- name: Print installed versions
id: versions
run: |
echo "::set-output name=rustc-version::$(rustc --version)"
rustc --version
echo "::set-output name=cargo-version::$(cargo --version)"
cargo --version
echo "::set-output name=rustup-version::$(rustup --version)"
rustup --version
echo "::set-output name=rustc-version::$(rustc +${{inputs.toolchain}} --version)"
rustc +${{inputs.toolchain}} --version --verbose
echo "::set-output name=cargo-version::$(cargo +${{inputs.toolchain}} --version)"
cargo +${{inputs.toolchain}} --version --verbose
echo "::set-output name=rustup-version::$(rustup +${{inputs.toolchain}} --version)"
rustup +${{inputs.toolchain}} --version
DATE=$(rustc +${{inputs.toolchain}} --version --verbose | sed -ne 's/^commit-date: \(20[0-9][0-9]\)-\([01][0-9]\)-\([0-3][0-9]\)$/\1\2\3/p')
HASH=$(rustc +${{inputs.toolchain}} --version --verbose | sed -ne 's/^commit-hash: //p')
echo "::set-output name=cachekey::$(echo $DATE$HASH | head -c12)"
shell: bash
- name: "Setup Rust Caching"
uses: Swatinem/rust-cache@v1
uses: Swatinem/rust-cache@v2
- name: "Install Rust Problem Matcher"
run: echo "::add-matcher::${{ github.action_path }}/rust.json"
shell: bash
@@ -73,5 +88,7 @@ runs:
run: |
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
echo "CARGO_PROFILE_DEV_DEBUG=0" >> $GITHUB_ENV
echo "CARGO_TERM_COLOR=always" >> $GITHUB_ENV
echo "RUST_BACKTRACE=short" >> $GITHUB_ENV
echo "RUSTFLAGS=-D warnings" >> $GITHUB_ENV
shell: bash