Cache docker images #4
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
# Workflow from https://reemus.dev/tldr/rust-cross-compilation-github-actions | ||
name: Build | ||
on: [push] | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.runner }} | ||
strategy: | ||
matrix: | ||
include: | ||
- name: linux-amd64 | ||
runner: ubuntu-latest | ||
target: aarch64-unknown-linux-musl | ||
command: cross | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Setup Cache | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Cache Docker images. | ||
uses: ScribeMD/docker-cache@0.3.7 | ||
with: | ||
key: docker-${{ runner.os }}-${{ hashFiles(paths) }} | ||
Check failure on line 27 in .github/workflows/rust.yml GitHub Actions / BuildInvalid workflow file
|
||
# Only install cross if we need it | ||
# Install via cargo-binstall which I found faster | ||
- name: Install Cross | ||
if: matrix.command == 'cross' | ||
shell: bash | ||
run: | | ||
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | ||
cargo binstall --no-confirm cross | ||
- name: Build Binary | ||
run: ${{ matrix.command }} build --verbose --locked --release --target ${{ matrix.target }} |