arm #33
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: Test images | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
cross: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [amd64, arm64] | |
target: | |
- aarch64-unknown-linux-gnu | |
- aarch64-unknown-linux-musl | |
- armv7-unknown-linux-gnueabihf | |
- armv7-unknown-linux-musleabihf | |
- riscv64gc-unknown-linux-gnu | |
# - riscv64gc-unknown-linux-musl | |
- s390x-unknown-linux-gnu | |
- x86_64-unknown-linux-gnu | |
- x86_64-unknown-linux-musl | |
# include: | |
# - target: aarch64-unknown-linux-gnu | |
# - target: aarch64-unknown-linux-musl | |
# - target: x86_64-unknown-freebsd | |
# - target: x86_64-unknown-netbsd | |
# - target: x86_64-unknown-illumos | |
# - target: x86_64-sun-solaris | |
# - target: riscv64gc-unknown-linux-gnu | |
# - target: powerpc64-unknown-linux-gnu | |
# - target: powerpc64le-unknown-linux-gnu | |
# - target: s390x-unknown-linux-gnu | |
# - target: mips64-unknown-linux-gnuabi64 | |
# - target: mips64-unknown-linux-muslabi64 | |
# - target: mips64el-unknown-linux-gnuabi64 | |
# - target: mips64el-unknown-linux-muslabi64 | |
# - target: i686-unknown-linux-gnu | |
# - target: i686-unknown-linux-musl | |
# - target: i686-unknown-freebsd | |
# - target: armv7-unknown-linux-gnueabihf | |
# - target: armv7-unknown-linux-musleabihf | |
# - target: powerpc-unknown-linux-gnu | |
# - target: mips-unknown-linux-gnu | |
# - target: mips-unknown-linux-musl | |
# - target: mipsel-unknown-linux-gnu | |
# - target: mipsel-unknown-linux-musl | |
# - target: x86_64-pc-windows-gnu | |
# - target: i686-pc-windows-gnu | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Docker Setup Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Vars | |
run: | | |
echo "BUILD_DATE=$(date --utc)" >> $GITHUB_ENV | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./ | |
file: ./cross-ink/${{ matrix.target }}.Dockerfile | |
# no-cache: true | |
cache-to: type=gha | |
cache-from: type=gha | |
pull: true | |
push: false | |
tags: cross:${{ matrix.target }} | |
# outputs: type=docker,dest=/tmp/cross-${{ matrix.target }}-${{ matrix.platform }}.tar | |
load: true | |
labels: | | |
tech.harmless.experimental.name="ink-cross:${{ matrix.target }}" | |
tech.harmless.experimental.pull_request_build="${{ github.event_name == 'pull_request' }}" | |
tech.harmless.experimental.run_number="${{ github.run_number }}" | |
tech.harmless.experimental.repo="${{ github.repositoryUrl }}" | |
tech.harmless.experimental.build_date="${{ env.BUILD_DATE }}" | |
tech.harmless.experimental.platform="${{ matrix.platform }}" | |
org.opencontainers.image.authors="harmless-tech, crow-rest" | |
platforms: linux/${{ matrix.platform }} | |
builder: ${{ steps.buildx.outputs.name }} | |
# - name: Upload image | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: cross-${{ matrix.target }}-${{ matrix.platform }} | |
# path: /tmp/cross-${{ matrix.target }}-${{ matrix.platform }}.tar | |
- name: Test | |
if: ${{ matrix.platform == 'amd64'}} | |
run: | | |
git clone https://github.com/cargo-prebuilt/cargo-prebuilt | |
cd cargo-prebuilt | |
docker run --rm --pull=never -v ./:/project cross:${{ matrix.target }} | |
file ./target/${{ matrix.target }}/debug/cargo-prebuilt |