2020-12-06 15:46:59 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2023-03-01 10:06:14 +00:00
|
|
|
- main
|
2020-12-06 15:46:59 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2023-03-01 10:06:14 +00:00
|
|
|
- main
|
2023-06-11 20:28:17 +00:00
|
|
|
merge_group:
|
|
|
|
|
2019-11-05 07:24:14 +00:00
|
|
|
|
|
|
|
name: CI
|
|
|
|
|
2020-12-06 17:31:54 +00:00
|
|
|
env:
|
2023-06-11 21:01:21 +00:00
|
|
|
CI_CARGO_MAKE_VERSION: 0.36.10
|
2020-12-06 17:31:54 +00:00
|
|
|
|
2019-11-05 07:24:14 +00:00
|
|
|
jobs:
|
2023-02-17 11:59:18 +00:00
|
|
|
test:
|
2020-08-02 14:17:57 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-06-11 20:28:17 +00:00
|
|
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
|
|
|
rust: [ "1.65.0", "stable" ]
|
2023-02-17 11:59:18 +00:00
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
2023-03-08 16:37:19 +00:00
|
|
|
triple: x86_64-unknown-linux-musl
|
2023-02-17 11:59:18 +00:00
|
|
|
- os: windows-latest
|
2023-03-08 16:37:19 +00:00
|
|
|
triple: x86_64-pc-windows-msvc
|
2023-02-17 11:59:18 +00:00
|
|
|
- os: macos-latest
|
2023-03-08 16:37:19 +00:00
|
|
|
triple: x86_64-apple-darwin
|
2023-02-17 11:59:18 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2019-11-05 07:24:14 +00:00
|
|
|
steps:
|
2023-02-17 00:55:51 +00:00
|
|
|
- uses: hecrj/setup-rust-action@50a120e4d34903c2c1383dec0e9b1d349a9cc2b1
|
2020-12-06 17:31:54 +00:00
|
|
|
with:
|
|
|
|
rust-version: ${{ matrix.rust }}
|
|
|
|
components: rustfmt,clippy
|
2023-02-17 11:59:18 +00:00
|
|
|
- uses: actions/checkout@v3
|
2023-03-08 16:37:19 +00:00
|
|
|
- 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
|
2021-11-11 14:56:37 +00:00
|
|
|
- name: "Format / Build / Test"
|
|
|
|
run: cargo make ci
|
2020-08-02 16:30:52 +00:00
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: full
|
2023-02-25 13:36:49 +00:00
|
|
|
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Checkout
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: "Check conventional commits"
|
|
|
|
uses: crate-ci/committed@master
|
|
|
|
with:
|
|
|
|
args: "-vv"
|
|
|
|
commits: "HEAD"
|
2023-03-16 14:00:52 +00:00
|
|
|
- name: "Check typos"
|
|
|
|
uses: crate-ci/typos@master
|
2023-06-04 15:32:20 +00:00
|
|
|
- name: "Lint dependencies"
|
|
|
|
uses: EmbarkStudios/cargo-deny-action@v1
|
2023-06-01 11:21:16 +00:00
|
|
|
|
|
|
|
coverage:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install stable
|
|
|
|
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
|
|
|
|
- name: Upload to codecov.io
|
|
|
|
uses: codecov/codecov-action@v3
|
|
|
|
with:
|
|
|
|
fail_ci_if_error: true
|