Update CHANGELOG.md #184
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: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-test: | |
name: build-and-test | |
runs-on: ${{ matrix.image }} | |
env: | |
# Emit backtraces on panics. | |
RUST_BACKTRACE: 1 | |
strategy: | |
matrix: | |
build: [linux-x64, macos-x64, win-x64-msvc] | |
include: | |
- build: linux-x64 | |
os: ubuntu | |
image: ubuntu-20.04 | |
target: x86_64-unknown-linux-gnu | |
- build: macos-x64 | |
os: macos | |
image: macos-12 | |
target: x86_64-apple-darwin | |
- build: win-x64-msvc | |
os: windows | |
image: windows-2022 | |
target: x86_64-pc-windows-msvc | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# See: https://github.com/actions/cache/blob/main/examples.md#rust---cargo | |
# And also https://github.com/rust-lang/rustup/blob/25dc87dc605adc0843c9369063333997ae806008/.github/workflows/linux-builds-on-stable.yaml#L81 | |
- name: Cache cargo registry and git trees | |
id: do-cache-cargo | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Get rustc commit hash | |
id: cargo-target-cache | |
run: | | |
echo "rust_hash=$(rustc -Vv | grep commit-hash | awk '{print $2}')" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Cache cargo build | |
id: do-cache-target | |
uses: actions/cache@v4 | |
with: | |
path: target | |
key: ${{ matrix.target }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }} | |
- name: cargo build | |
run: cargo build | |
- name: cargo test | |
run: cargo build | |
- name: Clear the cargo caches | |
if: ${{ ! steps.do-cache-cargo.outputs.cache-hit }} | |
run: | | |
cargo install cargo-cache --no-default-features --features ci-autoclean | |
cargo-cache |