Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/actions/cross-compile/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ runs:
uses: addnab/docker-run-action@v3
if: inputs.target != 'x86_64-unknown-linux-musl'
with:
image: ghcr.io/rust-cross/cargo-zigbuild:latest
# Pinned: 0.23.4 breaks linking cdylibs for Apple targets (sevenz-rust2
# builds one), see rust-cross/cargo-zigbuild#479, fixed by #480 but not
# released yet. Move to a release that contains #480, not to `latest`.
image: ghcr.io/rust-cross/cargo-zigbuild:0.23.3
options: >
-v ${{ github.workspace }}:/io
-w /io
Expand All @@ -36,6 +39,8 @@ runs:
rustup target add ${{ inputs.target }}
cargo zigbuild --release --target ${{ inputs.target }}

- name: List the artifacts
- name: Check the binary
shell: bash
run: ls target/${{ inputs.target }}/release/
run: |
ls -l target/${{ inputs.target }}/release/
test -f target/${{ inputs.target }}/release/totebag
58 changes: 37 additions & 21 deletions .github/workflows/cross-compile.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
name: cross-compile for testing
# Cross-compiles the release targets, the same way publish.yaml does, before a
# release is merged. The everyday build workflow only builds natively on Linux
# x86_64 and macOS arm64, so a problem in the cross toolchain (cargo-zigbuild,
# musl) otherwise surfaces only after the release pull request is merged, as it
# did for v0.10.0.
#
# It runs when a release branch is pushed, when the cross-compile action or
# this workflow changes, and on demand. Check that it is green before merging
# a release pull request.
name: cross-compile
on:
push:
branches:
- "test_workflow"
# - "**"
push:
branches:
- "release/v*"
pull_request:
paths:
- ".github/actions/cross-compile/**"
- ".github/workflows/cross-compile.yaml"
workflow_dispatch:

jobs:
cross-compile:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
- target: aarch64-unknown-linux-musl
- target: aarch64-apple-darwin
- target: x86_64-apple-darwin
steps:
- name: Checkout the project
uses: actions/checkout@v4
cross-compile:
runs-on: ubuntu-latest
strategy:
# Report every target, not only the first failure.
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- x86_64-apple-darwin
- aarch64-apple-darwin
steps:
- name: Checkout the project
uses: actions/checkout@v4

- name: Cross compile
uses: ./.github/actions/cross-compile
with:
target: ${{ matrix.target }}
- name: Cross compile
uses: ./.github/actions/cross-compile
with:
target: ${{ matrix.target }}
Loading