mirror of
https://github.com/actions-rust-lang/setup-rust-toolchain.git
synced 2025-12-27 01:54:20 -05:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c17331ebbf | ||
|
|
49e54cc50a | ||
|
|
29a2385140 | ||
|
|
8ba04cb6f2 | ||
|
|
5c0654516c | ||
|
|
d39b183d8d | ||
|
|
4018312e96 | ||
|
|
9015641f5c | ||
|
|
014f31d759 | ||
|
|
85cc8bd3df |
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal 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
38
CHANGELOG.md
Normal 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
|
||||
37
action.yml
37
action.yml
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user