Skip to content

build

build #344

Workflow file for this run

name: build
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
schedule:
- cron: "0 2 * * 0"
workflow_dispatch:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
jobs:
github_build:
name: Build release binaries
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: i686-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
- target: arm-unknown-linux-musleabi
os: ubuntu-latest
- target: armv7-unknown-linux-musleabi
os: ubuntu-latest
# - target: mips-unknown-linux-musl
# os: ubuntu-latest
# - target: mipsel-unknown-linux-musl
# os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Rust
uses: dtolnay/rust-toolchain@nightly
with:
target: ${{ matrix.target }}
- name: Test
run: cargo test --benches -- --nocapture
- name: Build | Build
uses: actions-rs/cargo@v1.0.3
with:
command: build
args: --release --locked --target ${{ matrix.target }}
use-cross: ${{ matrix.os == 'ubuntu-latest' }}
docker_build:
name: Docker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Build image
uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
tags: |
yinheli/kungfu:latest
yinheli/kungfu:${{ github.ref_name }}