diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cea7e7f56..ae4a9b778 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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