v0.1.16 #137
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
paths: | |
- "**/*.rs" | |
- "**/Cargo.toml" | |
- "**/Cargo.lock" | |
- ".github/workflows/build.yml" | |
pull_request: | |
paths: | |
- "**/*.rs" | |
- "**/Cargo.toml" | |
- "**/Cargo.lock" | |
- ".github/workflows/build.yml" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-11, ubuntu-latest, windows-latest] | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUST_BACKTRACE: full | |
CARGO_TERM_COLOR: always | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Install rust | |
uses: hecrj/setup-rust-action@v1 | |
with: | |
rust-version: "1.72.0" | |
- name: Install clippy and rustfmt | |
run: | | |
rustup component add clippy | |
rustup component add rustfmt | |
- name: Log versions | |
run: | | |
rustc --version | |
cargo --version | |
- name: Configure cargo data directory | |
# After this point, all cargo registry and crate data is stored in | |
# $GITHUB_WORKSPACE/.cargo_home. This allows us to cache only the files | |
# that are needed during the build process. Additionally, this works | |
# around a bug in the 'cache' action that causes directories outside of | |
# the workspace dir to be saved/restored incorrectly. | |
run: | | |
echo "CARGO_HOME=$(pwd)/.cargo_home" >> $GITHUB_ENV | |
- name: Cache | |
uses: actions/cache@v2 | |
with: | |
# Note: crates from the denoland/deno git repo always get rebuilt, | |
# and their outputs ('deno', 'libdeno.rlib' etc.) are quite big, | |
# so we cache only those subdirectories of target/{debug|release} that | |
# contain the build output for crates that come from the registry. | |
path: |- | |
.cargo_home | |
target/*/.* | |
target/*/build | |
target/*/deps | |
key: ${{ matrix.os }}-${{ hashFiles('Cargo.lock') }} | |
restore-keys: | | |
${{ matrix.os }}- | |
- name: Run cargo fmt | |
run: make format-check | |
- name: Run cargo check | |
run: make check | |
- name: Run cargo clippy | |
run: make lint | |
- name: Run cargo test | |
run: make test |