Skip to content

arm buildability in docker #376

arm buildability in docker

arm buildability in docker #376

Workflow file for this run

name: ci
on:
pull_request:
push:
branches:
- main
tags:
- '*'
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
#- linux/arm64
steps:
- uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# Build and push with docker buildx
- name: Setup docker buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-config: .github/buildkitd.toml
- name: Rust Build Cache for Docker
uses: actions/cache@v4
id: cache
with:
path: |
target
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-build-cache2-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os}}-build-cache2
- name: Create folders on cache miss
run: mkdir -p ~/.cargo/{git,registry} && mkdir -p target
- name: Inject cache into docker
uses: reproducible-containers/buildkit-cache-dance@v3
with:
cache-map: |
{
"target": "/volume/target",
"~/.cargo/registry": "/root/.cargo/registry",
"~/.cargo/git": "/root/.cargo/git"
}
# skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Configure tags based on git tags + latest
uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=pep440,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=pr
- name: Docker login
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker build and push with cache
uses: docker/build-push-action@v6
with:
context: .
# when not using buildkit cache
#cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
#cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
# when using buildkit-cache-dance
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags') }}
tags: ${{ steps.meta.outputs.tags }}
platforms: ${{ matrix.platform }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt,clippy
- run: cargo +nightly fmt -- --check
- uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-review'
github_token: ${{ secrets.GITHUB_TOKEN }}