Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,29 @@ jobs:
strategy:
fail-fast: true
matrix:
# 1.85 is the MSRV for the crate
rust: ['nightly', 'beta', 'stable', '1.85']
rust: ['nightly', 'beta', 'stable', 'msrv']

runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Install ${{matrix.rust}} toolchain
- name: Resolve version
id: resolve_version
run: echo "version=$(./scripts/resolve-toolchain-version.sh ${{matrix.rust}})" >> "${GITHUB_OUTPUT}"

- name: Install ${{ steps.resolve_version.outputs.version }} toolchain
if: matrix.rust == 'nightly'
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
toolchain: ${{ steps.resolve_version.outputs.version }}
components: miri rustfmt clippy

- name: Install ${{matrix.rust}} toolchain
- name: Install ${{ steps.resolve_version.outputs.version }} toolchain
if: matrix.rust != 'nightly'
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
toolchain: ${{ steps.resolve_version.outputs.version }}
components: rustfmt clippy

- uses: taiki-e/install-action@cargo-binstall
Expand All @@ -51,4 +54,4 @@ jobs:


- name: Run full test script
run: ./scripts/full-test.sh "${{matrix.rust}}"
run: ./scripts/full-test.sh "${{ steps.resolve_version.outputs.version }}"
21 changes: 21 additions & 0 deletions scripts/resolve-toolchain-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -o errexit # make script exit when a command fails
set -o nounset # make script exit when using undeclared variables
set -o pipefail # make script exit when command fails in a pipe
set -o xtrace # print a trace of all commands executed by script

if [ "$#" -ne 1 ]; then
>&2 echo "Illegal number of parameters [$#]"
>&2 echo "usage: ${0} <toolchain>"
exit 1
fi

MAYBE_RESOLVED="${1}"

if [[ "${MAYBE_RESOLVED}" == "msrv" ]]; then
MAYBE_RESOLVED="$(cargo metadata --no-deps --format-version 1 \
| jq -r '.packages | map(select(.name == "blart"))[0].rust_version')"
fi

echo "${MAYBE_RESOLVED}"
Loading