Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
purplesyringa committed Oct 30, 2024
1 parent 73e13a1 commit d1ee36e
Showing 1 changed file with 137 additions and 0 deletions.
137 changes: 137 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: CI

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
linux-intel:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x86_64, i686]
libc: [gnu, musl]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Add target
run: rustup target add ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}
- name: Test with panic backend
run: LITHIUM_BACKEND=panic cargo test --verbose --target ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}
- name: Test with Itanium backend
run: LITHIUM_BACKEND=itanium cargo test --verbose --target ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}

linux-aarch64:
runs-on: buildjet-2vcpu-ubuntu-2204-arm
strategy:
matrix:
libc: [gnu, musl]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Add target
run: rustup target add aarch64-unknown-linux-${{ matrix.libc }}
- name: Test with panic backend
run: LITHIUM_BACKEND=panic cargo test --verbose --target aarch64-unknown-linux-${{ matrix.libc }}
- name: Test with Itanium backend
run: LITHIUM_BACKEND=itanium cargo test --verbose --target aarch64-unknown-linux-${{ matrix.libc }}

linux-qemu:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- arm-unknown-linux-gnueabi
- arm-unknown-linux-gnueabihf
- armv7-unknown-linux-gnueabihf
- loongarch64-unknown-linux-gnu
- loongarch64-unknown-linux-musl
- powerpc64le-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- riscv64gc-unknown-linux-musl
- s390x-unknown-linux-gnu
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install Cross
run: cargo install cross
- name: Test with panic backend
run: LITHIUM_BACKEND=panic cross test --verbose --target ${{ matrix.target }}
- name: Test with Itanium backend
run: LITHIUM_BACKEND=itanium cross test --verbose --target ${{ matrix.target }}

darwin:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-15
- macos-15-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Test with panic backend
run: LITHIUM_BACKEND=panic cargo test --verbose
- name: Test with Itanium backend
run: LITHIUM_BACKEND=itanium cargo test --verbose

windows:
runs-on: windows-latest
strategy:
matrix:
arch: [x86_64, i686]
abi: [msvc, gnu]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set default-host
run: rustup set default-host ${{ matrix.arch }}-pc-windows-${{ matrix.abi }}
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Test with panic backend
run: set LITHIUM_BACKEND=panic && cargo test --verbose
- name: Test with SEH backend
if: matrix.abi == 'msvc'
run: set LITHIUM_BACKEND=seh && cargo test --verbose
- name: Test with Itanium backend
if: matrix.abi == 'gnu'
run: set LITHIUM_BACKEND=itanium && cargo test --verbose

# TODO: Restore this when strict provenance APIs are in stable.
# test_stable:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Install Rust
# run: rustup update stable && rustup default stable
# - name: Test with panic backend
# run: cargo test --verbose

lint:
runs-on: ubuntu-latest
strategy:
matrix:
backend: [panic, itanium, seh]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install rustfmt and clippy
run: rustup component add rustfmt clippy
- name: Rustfmt
run: LITHIUM_BACKEND=${{ matrix.backend }} cargo fmt -- --check
- name: Clippy
run: LITHIUM_BACKEND=${{ matrix.backend }} cargo clippy -- -D warnings

0 comments on commit d1ee36e

Please sign in to comment.