Skip to content

Implement cross compile to validate i686 in addition to x86_64 tests. #1116

Implement cross compile to validate i686 in addition to x86_64 tests.

Implement cross compile to validate i686 in addition to x86_64 tests. #1116

Workflow file for this run

name: Build and run tests
on:
push:
branches: [ main ]
paths:
- '**.rs'
- '**/Cargo.*'
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: build ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { target: i686-unknown-linux-gnu, use-cross: true }
- { target: x86_64-unknown-linux-gnu }
env:
BUILD_CMD: cargo
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.use-cross
uses: taiki-e/install-action@v2
with:
tool: cross
- name: Use cross as build tool
if: matrix.use-cross
run: echo "BUILD_CMD=cross" >> $GITHUB_ENV
- name: Build
run: $BUILD_CMD build --verbose --target=${{ matrix.target }}
- name: Check jaq-core without default features
if: ( ! matrix.use-cross )
working-directory: jaq-core
run: $BUILD_CMD check --no-default-features --target=${{ matrix.target }}
- name: Check jaq-std without default features
if: ( ! matrix.use-cross )
working-directory: jaq-std
run: $BUILD_CMD check --no-default-features --target=${{ matrix.target }}
- name: Check jaq-json without default features
if: ( ! matrix.use-cross )
working-directory: jaq-json
run: $BUILD_CMD check --no-default-features --target=${{ matrix.target }}
- name: Clippy
if: ( ! matrix.use-cross )
run: $BUILD_CMD clippy -- -Dwarnings --target=${{ matrix.target }}
- name: Run tests
run: $BUILD_CMD test --verbose --target=${{ matrix.target }}