diff --git a/.github/workflows/openblas-build.yml b/.github/workflows/openblas-build.yml index 1470212..72fc7a6 100644 --- a/.github/workflows/openblas-build.yml +++ b/.github/workflows/openblas-build.yml @@ -22,7 +22,7 @@ jobs: env: RUST_BACKTRACE: 1 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: "recursive" - name: Install gfortran by apt @@ -30,12 +30,6 @@ jobs: apt update apt install -y gfortran - name: Common minor tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=openblas-build/Cargo.toml + run: cargo test --manifest-path=openblas-build/Cargo.toml - name: Build test - uses: actions-rs/cargo@v1 - with: - command: test - args: ${{ matrix.test_target }} --manifest-path=openblas-build/Cargo.toml -- --ignored + run: cargo test ${{ matrix.test_target }} --manifest-path=openblas-build/Cargo.toml -- --ignored diff --git a/.github/workflows/openblas-src.yml b/.github/workflows/openblas-src.yml index 28affb6..2afa612 100644 --- a/.github/workflows/openblas-src.yml +++ b/.github/workflows/openblas-src.yml @@ -18,8 +18,8 @@ jobs: - x64-windows-static - x64-windows-static-md steps: - - uses: actions/checkout@v1 - - uses: actions/cache@v2 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: ./vcpkg key: vcpkg-openblas @@ -31,30 +31,20 @@ jobs: - name: Install OpenBLAS by vcpkg run: | ./vcpkg/vcpkg.exe install openblas:${{ matrix.triple }} - - - uses: actions-rs/cargo@v1 - name: Test features=system - with: - command: test - args: --features=system --manifest-path=openblas-src/Cargo.toml + - name: Test features=system + run: cargo test --features=system --manifest-path=openblas-src/Cargo.toml env: VCPKG_ROOT: ${{ github.workspace }}/vcpkg if: ${{ matrix.triple == 'x64-windows' }} - - uses: actions-rs/cargo@v1 - name: Test features=system,static - with: - command: test - args: --features=system,static --manifest-path=openblas-src/Cargo.toml + - name: Test features=system,static + run: cargo test --features=system,static --manifest-path=openblas-src/Cargo.toml env: VCPKG_ROOT: ${{ github.workspace }}/vcpkg if: ${{ matrix.triple == 'x64-windows-static-md' }} - - uses: actions-rs/cargo@v1 - name: Test features=system,static with crt-static - with: - command: test - args: --features=system,static --manifest-path=openblas-src/Cargo.toml + - name: Test features=system,static with crt-static + run: cargo test --features=system,static --manifest-path=openblas-src/Cargo.toml env: VCPKG_ROOT: ${{ github.workspace }}/vcpkg RUSTFLAGS: "-C target-feature=+crt-static" @@ -70,21 +60,17 @@ jobs: - static - system steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: "recursive" - name: Install OpenBLAS by homebrew run: | brew install openblas if: ${{ contains(matrix.feature, 'system') }} - - uses: actions-rs/cargo@v1 - with: - command: test - args: > - --features=${{ matrix.feature }} - --manifest-path=openblas-src/Cargo.toml + - name: Test features=${{ matrix.feature }} + run: cargo test --features=${{ matrix.feature }} --manifest-path=openblas-src/Cargo.toml - linux: + x86_64-unknown-linux-gnu: runs-on: ubuntu-22.04 container: image: rust @@ -96,7 +82,7 @@ jobs: - static - system steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: "recursive" - name: Install gfortran by apt @@ -108,9 +94,31 @@ jobs: apt update apt install -y libopenblas-dev if: ${{ contains(matrix.feature, 'system') }} - - uses: actions-rs/cargo@v1 + - name: Test features=${{ matrix.feature }} + run: cargo test --features=${{ matrix.feature }} --manifest-path=openblas-src/Cargo.toml + + cross: + name: ${{matrix.target}} (${{matrix.feature}}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + feature: + - "" + - static + - system + target: + - aarch64-unknown-linux-gnu + - armv7-unknown-linux-gnueabihf + steps: + - uses: actions/checkout@v4 + - name: Install toolchain + uses: dtolnay/rust-toolchain@stable + with: + target: ${{matrix.target}} + - name: Install Cross + uses: taiki-e/install-action@v2 with: - command: test - args: > - --features=${{ matrix.feature }} - --manifest-path=openblas-src/Cargo.toml + tool: cross + - name: Test features=${{ matrix.feature }} + run: cross test --target ${{matrix.target}} --features=${{ matrix.feature }} --manifest-path=openblas-src/Cargo.toml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5d1a2ef..a5e14fb 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -5,23 +5,21 @@ on: branches: - master pull_request: {} + workflow_dispatch: {} jobs: check-format: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v1 - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check + - uses: actions/checkout@v4 + - name: Check format + run: cargo fmt -- --check clippy: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: "true" - - uses: actions-rs/cargo@v1 - with: - command: clippy + - name: Check format + run: cargo clippy diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 0000000..5c9a998 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,28 @@ +[target.aarch64-unknown-linux-gnu] +image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main" +pre-build = [ + "dpkg --add-architecture $CROSS_DEB_ARCH", + "apt-get update && apt-get --assume-yes install libopenblas-dev:$CROSS_DEB_ARCH libssl-dev" +] +[target.aarch64-unknown-linux-gnu.env] +passthrough = [ + "OPENBLAS_CC=aarch64-linux-gnu-gcc", + "OPENBLAS_HOSTCC=gcc", + "OPENBLAS_FC=aarch64-linux-gnu-gfortran", + "OPENBLAS_TARGET=ARMV8" +] + +[target.armv7-unknown-linux-gnueabihf] +image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:main" +pre-build = [ + "dpkg --add-architecture $CROSS_DEB_ARCH", + "apt-get update && apt-get --assume-yes install libopenblas-dev:$CROSS_DEB_ARCH libssl-dev" +] +[target.armv7-unknown-linux-gnueabihf.env] +passthrough = [ + "OPENBLAS_CC=arm-linux-gnueabihf-gcc", + "OPENBLAS_HOSTCC=gcc", + "OPENBLAS_FC=arm-linux-gnueabihf-gfortran", + "OPENBLAS_TARGET=ARMV7" +] +