From 33acfce083a7a15ab8d7dbb48f572fccd6718b9b Mon Sep 17 00:00:00 2001 From: Linda_pp Date: Thu, 9 Mar 2023 01:37:19 +0900 Subject: [PATCH] fix(ci): Test MSRV compatibility on CI (#85) --- .github/workflows/ci.yml | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9ba2a7c..7f0d8e96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,14 +16,14 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - rust: ["1.63.0", "stable"] + rust: ["1.59.0", "stable"] include: - os: ubuntu-latest - cargo_make_path: ~/.cargo/bin/cargo-make + triple: x86_64-unknown-linux-musl - os: windows-latest - cargo_make_path: ~\.cargo\bin\cargo-make.exe + triple: x86_64-pc-windows-msvc - os: macos-latest - cargo_make_path: ~/.cargo/bin/cargo-make + triple: x86_64-apple-darwin runs-on: ${{ matrix.os }} steps: - uses: hecrj/setup-rust-action@50a120e4d34903c2c1383dec0e9b1d349a9cc2b1 @@ -31,15 +31,26 @@ jobs: rust-version: ${{ matrix.rust }} components: rustfmt,clippy - uses: actions/checkout@v3 - - name: "Cache cargo make" - id: cache-cargo-make - uses: actions/cache@v3 - with: - path: ${{ matrix.cargo_make_path }} - key: ${{ runner.os }}-${{ matrix.rust }}-cargo-make-${{ env.CI_CARGO_MAKE_VERSION }} - - name: "Install cargo-make" - if: steps.cache-cargo-make.outputs.cache-hit != 'true' - run: cargo install cargo-make --version ${{ env.CI_CARGO_MAKE_VERSION }} + - name: Install cargo-make on Linux or macOS + if: ${{ runner.os != 'windows' }} + shell: bash + run: | + curl -LO 'https://github.com/sagiegurari/cargo-make/releases/download/${{ env.CI_CARGO_MAKE_VERSION }}/cargo-make-v${{ env.CI_CARGO_MAKE_VERSION }}-${{ matrix.triple }}.zip' + unzip 'cargo-make-v${{ env.CI_CARGO_MAKE_VERSION }}-${{ matrix.triple }}.zip' + cp 'cargo-make-v${{ env.CI_CARGO_MAKE_VERSION }}-${{ matrix.triple }}/cargo-make' ~/.cargo/bin/ + cargo make --version + - name: Install cargo-make on Windows + if: ${{ runner.os == 'windows' }} + shell: bash + run: | + # `cargo-make-v0.35.16-{target}/` directory is created on Linux and macOS, but it is not creatd on Windows. + mkdir cargo-make-temporary + cd cargo-make-temporary + curl -LO 'https://github.com/sagiegurari/cargo-make/releases/download/${{ env.CI_CARGO_MAKE_VERSION }}/cargo-make-v${{ env.CI_CARGO_MAKE_VERSION }}-${{ matrix.triple }}.zip' + unzip 'cargo-make-v${{ env.CI_CARGO_MAKE_VERSION }}-${{ matrix.triple }}.zip' + cp cargo-make.exe ~/.cargo/bin/ + cd .. + cargo make --version - name: "Format / Build / Test" run: cargo make ci env: