Skip to content

Commit

Permalink
CI: features
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed Oct 17, 2024
1 parent 0b28c59 commit c342aa9
Showing 1 changed file with 104 additions and 59 deletions.
163 changes: 104 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,93 +7,138 @@ env:
RUSTDOCFLAGS: -D warnings

jobs:
library:
strategy:
matrix:
platform:
- ubuntu-latest
# library:
# strategy:
# matrix:
# platform:
# - ubuntu-latest

rust:
- stable
- beta
- nightly
- 1.81.0 # MSRV
# rust:
# - stable
# - beta
# - nightly
# - 1.81.0 # MSRV

include:
- platform: macos-latest # This serves as our aarch64 / arm64 runner
rust: stable
# include:
# - platform: macos-latest # This serves as our aarch64 / arm64 runner
# rust: stable

- platform: windows-latest
rust: stable
# - platform: windows-latest
# rust: stable

runs-on: ${{ matrix.platform }}
# runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4
# steps:
# - uses: actions/checkout@v4

- run: git submodule update --init --recursive
# - run: git submodule update --init --recursive

- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
# - uses: dtolnay/rust-toolchain@master
# with:
# toolchain: ${{ matrix.rust }}

- name: Unit Tests
run: cargo test --all-features
# - name: Unit Tests
# run: cargo test --all-features

- name: Property Tests
run: cargo test -p comparison --all-features
# - name: Property Tests
# run: cargo test -p comparison --all-features

miri:
runs-on: ubuntu-latest
env:
MIRIFLAGS: --cfg _internal_xxhash3_force_scalar
# miri:
# runs-on: ubuntu-latest
# env:
# MIRIFLAGS: --cfg _internal_xxhash3_force_scalar

steps:
- uses: actions/checkout@v4
# steps:
# - uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: miri
# - uses: dtolnay/rust-toolchain@master
# with:
# toolchain: nightly
# components: miri

- name: Unsafe Code
run: cargo miri test --all-features
# - name: Unsafe Code
# run: cargo miri test --all-features

- name: Big Endian Platform
run: cargo miri test --all-features --target s390x-unknown-linux-gnu
# - name: Big Endian Platform
# run: cargo miri test --all-features --target s390x-unknown-linux-gnu

lints:
runs-on: ubuntu-latest
# lints:
# runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
# steps:
# - uses: actions/checkout@v4

- run: git submodule update --init --recursive
# - run: git submodule update --init --recursive

- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy
# - uses: dtolnay/rust-toolchain@master
# with:
# toolchain: stable
# components: rustfmt, clippy

# - run: cargo fmt --all

# - run: cargo clippy --all --all-targets --all-features

- run: cargo fmt --all
# - run: cargo doc --all-features

- run: cargo clippy --all --all-targets --all-features
# no-std:
# runs-on: ubuntu-latest

- run: cargo doc --all-features
# steps:
# - uses: actions/checkout@v4

no-std:
# - uses: dtolnay/rust-toolchain@master
# with:
# toolchain: stable
# targets: thumbv6m-none-eabi

# - run: >
# cargo build
# --no-default-features
# --features=xxhash32,xxhash64,xxhash3_64
# --target thumbv6m-none-eabi

features:
runs-on: ubuntu-latest

env:
IMPLEMENTATIONS: xxhash32 xxhash64 xxhash3_64
FEATURE_SET: random serialize std alloc

steps:
- uses: actions/checkout@v4

- run: git submodule update --init --recursive

- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: thumbv6m-none-eabi

- run: >
cargo build
--no-default-features
--features=xxhash32,xxhash64,xxhash3_64
--target thumbv6m-none-eabi
- name: Compute Powerset
shell: "ruby {0}"
run: |
features = ENV['FEATURE_SET']
.split(' ')
.reduce([[]]) { |ps, i| ps + ps.map { |e| e + [i] } }
.map { |s| s.join(',') }
.join(" ")
File.open(ENV['GITHUB_ENV'], 'a') { |f| f.write("FEATURES=#{features}") }
- name: Check implementations with features
run: |
for impl in ${IMPLEMENTATIONS}; do
echo "::group::Implementation ${impl}"
# Check the implementation by itself
cargo check --no-default-features --features="${impl}"
# And with extra features
for feature in ${FEATURES}; do
echo "::group::Features ${feature}"
cargo check --no-default-features --features="${impl},${feature}"
echo "::endgroup::"
done
echo ::endgroup::
done

0 comments on commit c342aa9

Please sign in to comment.