Skip to content

Commit

Permalink
Implement cross compile to validate i686 in addition to x86_64 tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrupf committed Dec 14, 2024
1 parent 860a674 commit 345921f
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,43 @@ env:

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@v2
- 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: cargo build --verbose
run: $BUILD_CMD build --verbose --target=${{ matrix.target }}
- name: Check jaq-core without default features
working-directory: jaq-core
run: cargo check --no-default-features
run: $BUILD_CMD check --no-default-features --target=${{ matrix.target }}
- name: Check jaq-std without default features
working-directory: jaq-std
run: cargo check --no-default-features
run: $BUILD_CMD check --no-default-features --target=${{ matrix.target }}
- name: Check jaq-json without default features
working-directory: jaq-json
run: cargo check --no-default-features
run: $BUILD_CMD check --no-default-features --target=${{ matrix.target }}
- name: Clippy
run: cargo clippy -- -Dwarnings
if: ! matrix.use-cross
run: $BUILD_CMD clippy -- -Dwarnings --target=${{ matrix.target }}
- name: Run tests
run: cargo test --verbose
run: $BUILD_CMD test --verbose --target=${{ matrix.target }}

0 comments on commit 345921f

Please sign in to comment.