Skip to content

ci: win32 doesn't like any target-cpu specified #272

ci: win32 doesn't like any target-cpu specified

ci: win32 doesn't like any target-cpu specified #272

Workflow file for this run

name: Test
on:
push:
branches:
- '*'
tags-ignore:
- 'v*'
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
if: false
env:
PROFILE: release
strategy:
fail-fast: false
matrix:
# setup different OS and targets
include:
- name: x86_64-ubuntu-20
os: ubuntu-20.04
target-cpu: x86-64
target: x86_64-unknown-linux-gnu
nuget-rid: linux-x64
- name: x86_64-ubuntu-22
os: ubuntu-22.04
target-cpu: x86-64
target: x86_64-unknown-linux-gnu
nuget-rid: linux-x64
- name: x86_64-windows
os: windows-2022
target-cpu: x86-64
target: x86_64-pc-windows-msvc
nuget-rid: win-x64
- name: x86_64-macos-13
os: macos-13
target-cpu: haswell
target: x86_64-apple-darwin
nuget-rid: osx-x64
- name: ARM64-macos-14
os: macos-14
target-cpu: apple-m1
target: aarch64-apple-darwin
nuget-rid: osx-arm64
- name: ARM64-ubuntu-24
os: ubuntu-24-arm-32gb
target-cpu: generic
target: aarch64-unknown-linux-gnu
features: neon
cross: 'true'
nuget-rid: linux-arm64
- name: win32
os: windows-2022
target: i686-pc-windows-msvc
cross: 'true'
nuget-rid: win-x86
- name: x64-linux-musl
os: ubuntu-24.04
target-cpu: x86-64
target: x86_64-unknown-linux-musl
target-feature: +crt-static
features: mimalloc
cross: 'true'
nuget-rid: linux-x64
# todo target: aarch64-pc-windows-msvc instead of in test_woa.yml (once an official image is released)
# todo: Someday rewrite imageflow for wasm32-unknown-emscripten
# todo: Won't pass tests due to https://github.com/NoXF/libwebp-sys/issues/36
- name: arm64-linux-musl
os: ubuntu-24-arm-32gb # ubuntu-24.04 # cross doesn't support ubuntu-24-arm-32gb
target-cpu: generic
target-feature: +crt-static
target: aarch64-unknown-linux-musl
features: mimalloc
cross: 'true'
nuget-rid: linux-arm64
runs-on: ${{matrix.os}}
name: "${{ (matrix.cross == 'true') && 'cross ' || ''}}${{ matrix.name }}${{ matrix.target-cpu && format(' cpu: {0}', matrix.target-cpu) }}${{ matrix.target && format(' target: {0}', matrix.target) }}${{ matrix.features && format(' features: {0}', matrix.features) }} runs-on:${{ matrix.os }}"
steps:
- run: rustup show
- name: Checkout code
uses: actions/checkout@v4
# matrix item NOT using cross
- uses: Swatinem/rust-cache@v2
with:
key: ${{matrix.name}}
if: matrix.cross != 'true'
- uses: dtolnay/rust-toolchain@stable
if: matrix.cross != 'true'
- run: rustup show
- name: Install NASM
uses: ./.github/actions/install-nasm
if: matrix.cross != 'true'
- name: Set ENV vars TARGET_DIR, REL_BINARIES_DIR, RUSTFLAGS
shell: bash
run: |
echo "TARGET_DIR=target/${{ matrix.target }}/" >> $GITHUB_ENV
echo "REL_BINARIES_DIR=target/${{ matrix.target }}/release/" >> $GITHUB_ENV
echo "RUSTFLAGS=${{ matrix.target-cpu && format('-Ctarget-cpu={0}',matrix.target-cpu) }} ${{ matrix.target-feature && format('-Ctarget-feature={0}',matrix.target-feature) }}" >> $GITHUB_ENV
echo "CARGO_PROFILE_TARGET_FEATURES_ARGS=--${{ env.PROFILE }} ${{ matrix.target && format('--target={0}',matrix.target) }} ${{ matrix.features && format('--features={0}',matrix.features) }}" >> $GITHUB_ENV
echo "CROSS_ARGS=--locked --${{ env.PROFILE }} ${{ matrix.features && format('--features={0}',matrix.features) }}" >> $GITHUB_ENV
echo "REL_BINARIES_DIR=target/${{ matrix.target }}/${{ env.PROFILE }}/" >> $GITHUB_ENV
- name: "cargo test --all --locked ${{ env.CARGO_PROFILE_TARGET_FEATURES_ARGS }}"
run: cargo test --all --locked ${{ env.CARGO_PROFILE_TARGET_FEATURES_ARGS }}
shell: bash
if: matrix.cross != 'true'
# now do a standard build
- name: "cargo build --all --locked ${{ env.CARGO_PROFILE_TARGET_FEATURES_ARGS }}"
run: cargo build --all --locked ${{ env.CARGO_PROFILE_TARGET_FEATURES_ARGS }}
shell: bash
if: matrix.cross != 'true'
# matrix items USING CROSS
- name: "cross cargo test --target ${{ matrix.target }} ${{ env.CROSS_ARGS }}"
uses: houseabsolute/[email protected]
env:
RUSTFLAGS: ${{ env.RUSTFLAGS }}
with:
command: "test"
target: ${{ matrix.target }}
toolchain: stable
args: "${{ env.CROSS_ARGS }}"
if: matrix.cross == 'true'
- name: "cross cargo build --target ${{ matrix.target }} ${{ env.CROSS_ARGS }}"
uses: houseabsolute/[email protected]
env:
RUSTFLAGS: ${{ env.RUSTFLAGS }}
with:
command: "build"
target: ${{ matrix.target }}
toolchain: stable
args: "${{ env.CROSS_ARGS }}"
if: matrix.cross == 'true'