Skip to content

Commit

Permalink
build: expand targets for x64/x86 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kkent030315 committed Nov 24, 2024
1 parent 48da3d8 commit aee5d9a
Showing 1 changed file with 60 additions and 32 deletions.
92 changes: 60 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: CI
on:
push:
pull_request:
branches:
- master
branches:
- master

jobs:
test:
Expand All @@ -12,52 +12,80 @@ jobs:
strategy:
matrix:
build: [MSRV, stable, nightly, macos, win32, win64]
target:
- x86_64-unknown-linux-gnu # Linux x64
- i686-unknown-linux-gnu # Linux x86
- x86_64-apple-darwin # macOS x64
- i686-pc-windows-msvc # Windows x86
- x86_64-pc-windows-msvc # Windows x64
include:
# Linux configurations
- build: MSRV # Minimum supported Rust version
rust: 1.63.0
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- build: MSRV # Minimum supported Rust version
rust: 1.63.0
target: i686-unknown-linux-gnu
os: ubuntu-latest
- build: stable
rust: stable
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- build: stable
rust: stable
target: i686-unknown-linux-gnu
os: ubuntu-latest
- build: nightly
rust: nightly
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- build: nightly
rust: nightly
target: i686-unknown-linux-gnu
os: ubuntu-latest
# macOS configuration
- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
os: macos-latest
# Windows configurations
- build: win32
rust: stable
target: i686-pc-windows-msvc
os: windows-latest
rust: stable-i686-msvc
- build: win64
rust: stable
target: x86_64-pc-windows-msvc
os: windows-latest
rust: stable-x86_64-msvc
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
steps:
- uses: actions/checkout@master
- name: Cache CARGO_HOME
uses: actions/cache@v1
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-home-${{ hashFiles('**/Cargo.toml') }}
restore-keys: ${{ runner.os }}-cargo-home
- name: Install Rust
shell: bash
run: |
curl -sSL https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain=none
export PATH="$HOME/.cargo/bin:$PATH"
rustup override set ${{ matrix.rust }}
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: rustfmt
shell: bash
if: runner.os == 'Linux' && matrix.rust == 'stable'
run: |
rustup component add rustfmt
cargo fmt -- --check
- run: cargo build
- run: cargo build --all-targets
# FIXME: Looks like fuzzer cannot be run on Windows
- if: runner.os == 'Linux'
run: cargo build --manifest-path=fuzz/Cargo.toml
- run: cargo test
- run: make api
- uses: actions/checkout@master
- name: Cache CARGO_HOME
uses: actions/cache@v1
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-home-${{ hashFiles('**/Cargo.toml') }}
restore-keys: ${{ runner.os }}-cargo-home
- name: Install Rust
shell: bash
run: |
curl -sSL https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain=none
export PATH="$HOME/.cargo/bin:$PATH"
rustup override set ${{ matrix.rust }}
rustup target add ${{ matrix.target }}
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: rustfmt
shell: bash
if: runner.os == 'Linux' && matrix.rust == 'stable'
run: |
rustup component add rustfmt
cargo fmt -- --check
- run: cargo build --target ${{ matrix.target }}
- run: cargo build --all-targets --target ${{ matrix.target }}
# FIXME: Looks like fuzzer cannot be run on Windows
- if: runner.os == 'Linux'
run: cargo build --manifest-path=fuzz/Cargo.toml --target ${{ matrix.target }}
- run: cargo test --target ${{ matrix.target }}
- run: make api

0 comments on commit aee5d9a

Please sign in to comment.