Skip to content

Update toolchain and dependencies #83

Update toolchain and dependencies

Update toolchain and dependencies #83

Workflow file for this run

name: Rust
on:
push:
branches: [main]
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTUP_MAX_RETRIES: 10
jobs:
checks:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
toolchain:
- 1.79.0
- stable
- nightly
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-${{ matrix.toolchain }}
- name: Build
run: cargo build
- name: Run tests
run: cargo test
- name: clippy
run: cargo clippy -- --deny "warnings"
- name: fmt
run: cargo fmt -- --check
linux-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.79.0-binary
- name: Install musl tools
run: sudo apt-get install -y musl-tools
- name: Build
run: |
cargo build --release --target x86_64-unknown-linux-musl
strip target/x86_64-unknown-linux-musl/release/amber
- name: Rename
run: |
mkdir artifacts
cp target/x86_64-unknown-linux-musl/release/amber artifacts/amber-x86_64-unknown-linux-musl
- uses: actions/upload-artifact@v2
with:
name: binaries
path: artifacts/*
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: artifacts/amber-x86_64-unknown-linux-musl
generate_release_notes: true
macos-binary:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.79.0-binary
- name: Build
run: cargo build --release
- name: Rename
run: |
mkdir artifacts
cp target/release/amber artifacts/amber-x86_64-apple-darwin
- uses: actions/upload-artifact@v2
with:
name: binaries
path: artifacts/*
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: artifacts/amber-x86_64-apple-darwin
generate_release_notes: true
windows-binary:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.79.0
profile: minimal
override: true
- uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.79.0-binary
- name: Build
run: cargo build --release
- name: Rename
run: |
mkdir artifacts
cp target/release/amber.exe artifacts/amber-x86_64-pc-windows-gnu.exe
- uses: actions/upload-artifact@v2
with:
name: binaries
path: artifacts/*
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: artifacts/amber-x86_64-pc-windows-gnu.exe
generate_release_notes: true