Skip to content

Commit

Permalink
rewrite CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirreke committed Nov 25, 2024
1 parent e1a0a3f commit 91237ce
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 75 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/cross.yml

This file was deleted.

14 changes: 5 additions & 9 deletions .github/workflows/openblas-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,16 @@ jobs:
env:
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install gfortran by apt
run: |
apt update
apt install -y gfortran
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- 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
78 changes: 46 additions & 32 deletions .github/workflows/openblas-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,30 +31,22 @@ 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: Install toolchain
uses: dtolnay/rust-toolchain@stable
- 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"
Expand All @@ -70,21 +62,19 @@ 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: Install toolchain
uses: dtolnay/rust-toolchain@stable
- 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
Expand All @@ -96,7 +86,7 @@ jobs:
- static
- system
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install gfortran by apt
Expand All @@ -108,9 +98,33 @@ jobs:
apt update
apt install -y libopenblas-dev
if: ${{ contains(matrix.feature, 'system') }}
- uses: actions-rs/cargo@v1
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- name: Test features=${{ matrix.feature }}
run: cargo test --features=${{ matrix.feature }} --manifest-path=openblas-src/Cargo.toml

cross:
name: ${{matrix.target}}
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
20 changes: 13 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,29 @@ 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
- uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
command: fmt
args: -- --check
components: rustfmt
- 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
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
command: clippy
components: clippy
- name: Check format
run: cargo clippy
20 changes: 18 additions & 2 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,12 +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 gfortran-aarch64-linux-gnu gcc-aarch64-linux-gnu libssl-dev:$CROSS_DEB_ARCH libssl-dev"
"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=NEOVERSEN1"
"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=armv7-linux-gnueabihf-gcc",
"OPENBLAS_HOSTCC=gcc",
"OPENBLAS_FC=armv7-linux-gnueabihf-gfortran",
"OPENBLAS_TARGET=ARMV7"
]

0 comments on commit 91237ce

Please sign in to comment.