Skip to content

Commit

Permalink
refactor(ci): simplify cargo-make installation (ratatui#240)
Browse files Browse the repository at this point in the history
* refactor(ci): simplify cargo-make installation

* chore(ci): use the latest version of cargo-make

* refactor(ci): remove unused triple values

* chore(ci): list all steps before ci

* fix(ci): checkout the repository

* refactor(ci): remove unnecessary os variables

* refactor(ci): use dtolnay/rust-toolchain action
  • Loading branch information
orhun authored and samyosm committed Jun 18, 2023
1 parent cac48a1 commit 973fd2e
Showing 1 changed file with 11 additions and 36 deletions.
47 changes: 11 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,27 @@ on:

name: CI

env:
CI_CARGO_MAKE_VERSION: 0.36.10

jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
rust: [ "1.65.0", "stable" ]
include:
- os: ubuntu-latest
triple: x86_64-unknown-linux-musl
- os: windows-latest
triple: x86_64-pc-windows-msvc
- os: macos-latest
triple: x86_64-apple-darwin
toolchain: [ "1.65.0", "stable" ]
runs-on: ${{ matrix.os }}
steps:
- uses: hecrj/setup-rust-action@50a120e4d34903c2c1383dec0e9b1d349a9cc2b1
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
rust-version: ${{ matrix.rust }}
toolchain: ${{ matrix.toolchain }}
components: rustfmt,clippy
- uses: actions/checkout@v3
- 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
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cargo-make
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 binstall -y cargo-make
cargo make --version
cargo make --list-all-steps
- name: "Format / Build / Test"
run: cargo make ci
env:
Expand Down Expand Up @@ -83,14 +61,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install stable
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools
- name: cargo install cargo-llvm-cov
# Cargo subcommand to easily use LLVM source-based code coverage.
# see https://github.com/taiki-e/cargo-llvm-cov
# and https://github.com/taiki-e/install-action
uses: taiki-e/install-action@cargo-llvm-cov
- name: cargo llvm-cov
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
Expand Down

0 comments on commit 973fd2e

Please sign in to comment.