From 28a2ec393a8d3c498c3ab6dab06552b6cbc93ca5 Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Sat, 10 Jun 2023 10:26:35 +0200 Subject: [PATCH 1/5] Update CI actions --- .github/workflows/ci.yml | 77 +++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 844c606e..508b34bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,29 +25,28 @@ jobs: - {command: clippy, rust: stable} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Rust (${{matrix.rust}}) - uses: actions-rs/toolchain@v1 - with: {profile: minimal, toolchain: '${{matrix.rust}}', override: true, components: 'rustfmt, clippy'} + uses: dtolnay/rust-toolchain@stable + with: {toolchain: '${{matrix.rust}}', components: 'rustfmt, clippy'} - name: Install HDF5 run: sudo apt-get install libhdf5-dev - name: Run cargo ${{matrix.command}} - uses: actions-rs/cargo@v1 - with: - command: ${{matrix.command}} - args: "${{matrix.command == 'fmt' && '--all -- --check' || '--workspace --exclude hdf5-src -- -D warnings -D clippy::cargo -A clippy::multiple-crate-versions'}}" + run: cargo ${{matrix.command}} "${{matrix.command == 'fmt' && '--all -- --check' || '--workspace --exclude hdf5-src -- -D warnings -D clippy::cargo -A clippy::multiple-crate-versions'}}" doc: # This task should mirror the procedure on docs.rs runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: {submodules: true} - name: Install Rust (${{matrix.rust}}) - uses: actions-rs/toolchain@v1 - with: {toolchain: nightly, profile: minimal, override: true} + uses: dtolnay/rust-toolchain@stable + with: {toolchain: nightly} - name: Document workspace - run: env RUSTDOCFLAGS="--cfg docsrs" cargo doc --features hdf5-sys/static,hdf5-sys/zlib,blosc,lzf + env: + RUSTDOCFLAGS="--cfg docsrs" + run: cargo doc --features hdf5-sys/static,hdf5-sys/zlib,blosc,lzf brew: name: brew @@ -62,11 +61,11 @@ jobs: - {version: hdf5-mpi, mpi: true} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: {submodules: true} - name: Install Rust (${{matrix.rust}}) - uses: actions-rs/toolchain@v1 - with: {toolchain: stable, profile: minimal, override: true} + uses: dtolnay/rust-toolchain@stable + with: {toolchain: stable} - name: Install HDF5 (${{matrix.version}}) run: brew install ${{matrix.version}} - name: Build and test all crates @@ -107,11 +106,11 @@ jobs: shell: bash -l {0} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: {submodules: true} - name: Install Rust (${{matrix.rust}}) - uses: actions-rs/toolchain@v1 - with: {toolchain: '${{matrix.rust}}', profile: minimal, override: true} + uses: dtolnay/rust-toolchain@stable + with: {toolchain: '${{matrix.rust}}'} - name: Install conda uses: conda-incubator/setup-miniconda@v2 with: {auto-update-conda: false, activate-environment: testenv} @@ -141,11 +140,11 @@ jobs: - {os: macos, rust: stable} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: {submodules: true} - name: Install Rust (${{matrix.rust}}) - uses: actions-rs/toolchain@v1 - with: {toolchain: '${{matrix.rust}}', profile: minimal, override: true} + uses: dtolnay/rust-toolchain@stable + with: {toolchain: '${{matrix.rust}}'} - name: Build and test all crates run: cargo test --workspace -v --features hdf5-sys/static,hdf5-sys/zlib --exclude hdf5-derive - name: Build and test with filters @@ -168,11 +167,11 @@ jobs: - {mpi: openmpi, rust: stable} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: {submodules: true} - name: Install Rust (${{matrix.rust}}) - uses: actions-rs/toolchain@v1 - with: {toolchain: '${{matrix.rust}}', profile: minimal, override: true} + uses: dtolnay/rust-toolchain@stable + with: {toolchain: '${{matrix.rust}}'} - name: Install HDF5 (${{matrix.mpi}}) run: | [ "${{matrix.mpi}}" == "mpich" ] && PACKAGES="libhdf5-mpich-dev mpich" @@ -200,11 +199,11 @@ jobs: version: ["1.8", "1.10", "1.12", "1.14"] steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: {submodules: true} - name: Install Rust (${{matrix.rust}}) - uses: actions-rs/toolchain@v1 - with: {toolchain: '${{matrix.rust}}', profile: minimal, override: true} + uses: dtolnay/rust-toolchain@stable + with: {toolchain: '${{matrix.rust}}'} - name: Configure environment shell: bash run: | @@ -270,11 +269,11 @@ jobs: fail-fast: false steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: {submodules: true} - name: Install Rust - uses: actions-rs/toolchain@v1 - with: {toolchain: 1.64, profile: minimal, override: true} + uses: dtolnay/rust-toolchain@stable + with: {toolchain: 1.64} - name: Build and test all crates run: cargo test --workspace -vv --features=hdf5-sys/static --exclude=hdf5-derive @@ -285,25 +284,29 @@ jobs: # runs-on: ubuntu-latest # steps: # - name: Checkout repository - # uses: actions/checkout@v2 + # uses: actions/checkout@v3 # with: {submodules: true} # - name: Install Rust - # uses: actions-rs/toolchain@v1 - # with: {toolchain: stable, target: x86_64-pc-windows-gnu, profile: minimal, override: true} + # uses: dtolnay/rust-toolchain@stable + # with: {toolchain: stable, targets: x86_64-pc-windows-gnu} # - name: Install dependencies # run: sudo apt-get update && sudo apt install wine64 mingw-w64 # - name: Build and test - # run: env CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER=wine64 cargo test --features hdf5-sys/static --target x86_64-pc-windows-gnu -- --skip test_compile_fail - + # env: + # CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER=wine64 + # run: cargo test --features hdf5-sys/static --target x86_64-pc-windows-gnu -- --skip test_compile_fail + addr_san: name: Address sanitizer runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: {submodules: true} - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: {toolchain: nightly, profile: minimal, override: true} - name: Run test with sanitizer - run: env RUSTFLAGS="-Z sanitizer=address" cargo test --features hdf5-sys/static --target x86_64-unknown-linux-gnu --workspace --exclude hdf5-derive + env: + RUSTFLAGS="-Z sanitizer=address" + run: cargo test --features hdf5-sys/static --target x86_64-unknown-linux-gnu --workspace --exclude hdf5-derive From 274ba3b058b6726991d2df9e53b89295802fab0e Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Sat, 10 Jun 2023 10:27:04 +0200 Subject: [PATCH 2/5] Reenable wine in CI --- .github/workflows/ci.yml | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 508b34bb..416aa816 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -278,23 +278,22 @@ jobs: run: cargo test --workspace -vv --features=hdf5-sys/static --exclude=hdf5-derive - # # TODO: temporarily disabled until fixed (see https://github.com/aldanor/hdf5-rust/issues/241) - # wine: - # name: wine - # runs-on: ubuntu-latest - # steps: - # - name: Checkout repository - # uses: actions/checkout@v3 - # with: {submodules: true} - # - name: Install Rust - # uses: dtolnay/rust-toolchain@stable - # with: {toolchain: stable, targets: x86_64-pc-windows-gnu} - # - name: Install dependencies - # run: sudo apt-get update && sudo apt install wine64 mingw-w64 - # - name: Build and test - # env: - # CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER=wine64 - # run: cargo test --features hdf5-sys/static --target x86_64-pc-windows-gnu -- --skip test_compile_fail + wine: + name: wine + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: {submodules: true} + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: {toolchain: stable, targets: x86_64-pc-windows-gnu} + - name: Install dependencies + run: sudo apt-get update && sudo apt install wine64 mingw-w64 + - name: Build and test + env: + CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER=wine64 + run: cargo test --features hdf5-sys/static --target x86_64-pc-windows-gnu -- --skip test_compile_fail addr_san: name: Address sanitizer From 60e546bce213e3aa0e365c3218d4689fa6cb1693 Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Sat, 10 Jun 2023 10:29:19 +0200 Subject: [PATCH 3/5] fixup syntax --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 416aa816..cd9e9eb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: with: {toolchain: nightly} - name: Document workspace env: - RUSTDOCFLAGS="--cfg docsrs" + RUSTDOCFLAGS: "--cfg docsrs" run: cargo doc --features hdf5-sys/static,hdf5-sys/zlib,blosc,lzf brew: @@ -292,7 +292,7 @@ jobs: run: sudo apt-get update && sudo apt install wine64 mingw-w64 - name: Build and test env: - CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER=wine64 + CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER: wine64 run: cargo test --features hdf5-sys/static --target x86_64-pc-windows-gnu -- --skip test_compile_fail addr_san: @@ -307,5 +307,5 @@ jobs: with: {toolchain: nightly, profile: minimal, override: true} - name: Run test with sanitizer env: - RUSTFLAGS="-Z sanitizer=address" + RUSTFLAGS: "-Z sanitizer=address" run: cargo test --features hdf5-sys/static --target x86_64-unknown-linux-gnu --workspace --exclude hdf5-derive From 99d8d84da2413f278687a0f33fb304f99f288a79 Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Sat, 10 Jun 2023 10:31:11 +0200 Subject: [PATCH 4/5] fixup syntax --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd9e9eb3..043fdf5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: - name: Install HDF5 run: sudo apt-get install libhdf5-dev - name: Run cargo ${{matrix.command}} - run: cargo ${{matrix.command}} "${{matrix.command == 'fmt' && '--all -- --check' || '--workspace --exclude hdf5-src -- -D warnings -D clippy::cargo -A clippy::multiple-crate-versions'}}" + run: cargo ${{matrix.command}} ${{matrix.command == 'fmt' && '--all -- --check' || '--workspace --exclude hdf5-src -- -D warnings -D clippy::cargo -A clippy::multiple-crate-versions'}} doc: # This task should mirror the procedure on docs.rs runs-on: ubuntu-latest From d1864c7db79da4208ceb70c0bf8894a16775e695 Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Sat, 10 Jun 2023 23:20:25 +0200 Subject: [PATCH 5/5] Update CI mingw job --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 043fdf5e..329929e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -245,11 +245,11 @@ jobs: rust: [stable] steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: {submodules: true} - name: Install Rust (${{matrix.rust}}) - uses: actions-rs/toolchain@v1 - with: {toolchain: '${{matrix.rust}}', target: x86_64-pc-windows-gnu, profile: minimal, override: true} + uses: dtolnay/rust-toolchain@stable + with: {toolchain: '${{matrix.rust}}', targets: x86_64-pc-windows-gnu} - name: Install HDF5 shell: pwsh run: |