Skip to content

Commit 91237ce

Browse files
committed
rewrite CI
1 parent e1a0a3f commit 91237ce

File tree

5 files changed

+82
-75
lines changed

5 files changed

+82
-75
lines changed

.github/workflows/cross.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/openblas-build.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,16 @@ jobs:
2222
env:
2323
RUST_BACKTRACE: 1
2424
steps:
25-
- uses: actions/checkout@v1
25+
- uses: actions/checkout@v4
2626
with:
2727
submodules: "recursive"
2828
- name: Install gfortran by apt
2929
run: |
3030
apt update
3131
apt install -y gfortran
32+
- name: Install toolchain
33+
uses: dtolnay/rust-toolchain@stable
3234
- name: Common minor tests
33-
uses: actions-rs/cargo@v1
34-
with:
35-
command: test
36-
args: --manifest-path=openblas-build/Cargo.toml
35+
run: cargo test --manifest-path=openblas-build/Cargo.toml
3736
- name: Build test
38-
uses: actions-rs/cargo@v1
39-
with:
40-
command: test
41-
args: ${{ matrix.test_target }} --manifest-path=openblas-build/Cargo.toml -- --ignored
37+
run: cargo test ${{ matrix.test_target }} --manifest-path=openblas-build/Cargo.toml -- --ignored

.github/workflows/openblas-src.yml

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
- x64-windows-static
1919
- x64-windows-static-md
2020
steps:
21-
- uses: actions/checkout@v1
22-
- uses: actions/cache@v2
21+
- uses: actions/checkout@v4
22+
- uses: actions/cache@v4
2323
with:
2424
path: ./vcpkg
2525
key: vcpkg-openblas
@@ -31,30 +31,22 @@ jobs:
3131
- name: Install OpenBLAS by vcpkg
3232
run: |
3333
./vcpkg/vcpkg.exe install openblas:${{ matrix.triple }}
34-
35-
- uses: actions-rs/cargo@v1
36-
name: Test features=system
37-
with:
38-
command: test
39-
args: --features=system --manifest-path=openblas-src/Cargo.toml
34+
- name: Install toolchain
35+
uses: dtolnay/rust-toolchain@stable
36+
- name: Test features=system
37+
run: cargo test --features=system --manifest-path=openblas-src/Cargo.toml
4038
env:
4139
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
4240
if: ${{ matrix.triple == 'x64-windows' }}
4341

44-
- uses: actions-rs/cargo@v1
45-
name: Test features=system,static
46-
with:
47-
command: test
48-
args: --features=system,static --manifest-path=openblas-src/Cargo.toml
42+
- name: Test features=system,static
43+
run: cargo test --features=system,static --manifest-path=openblas-src/Cargo.toml
4944
env:
5045
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
5146
if: ${{ matrix.triple == 'x64-windows-static-md' }}
5247

53-
- uses: actions-rs/cargo@v1
54-
name: Test features=system,static with crt-static
55-
with:
56-
command: test
57-
args: --features=system,static --manifest-path=openblas-src/Cargo.toml
48+
- name: Test features=system,static with crt-static
49+
run: cargo test --features=system,static --manifest-path=openblas-src/Cargo.toml
5850
env:
5951
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
6052
RUSTFLAGS: "-C target-feature=+crt-static"
@@ -70,21 +62,19 @@ jobs:
7062
- static
7163
- system
7264
steps:
73-
- uses: actions/checkout@v1
65+
- uses: actions/checkout@v4
7466
with:
7567
submodules: "recursive"
7668
- name: Install OpenBLAS by homebrew
7769
run: |
7870
brew install openblas
7971
if: ${{ contains(matrix.feature, 'system') }}
80-
- uses: actions-rs/cargo@v1
81-
with:
82-
command: test
83-
args: >
84-
--features=${{ matrix.feature }}
85-
--manifest-path=openblas-src/Cargo.toml
72+
- name: Install toolchain
73+
uses: dtolnay/rust-toolchain@stable
74+
- name: Test features=${{ matrix.feature }}
75+
run: cargo test --features=${{ matrix.feature }} --manifest-path=openblas-src/Cargo.toml
8676

87-
linux:
77+
x86_64-unknown-linux-gnu:
8878
runs-on: ubuntu-22.04
8979
container:
9080
image: rust
@@ -96,7 +86,7 @@ jobs:
9686
- static
9787
- system
9888
steps:
99-
- uses: actions/checkout@v1
89+
- uses: actions/checkout@v4
10090
with:
10191
submodules: "recursive"
10292
- name: Install gfortran by apt
@@ -108,9 +98,33 @@ jobs:
10898
apt update
10999
apt install -y libopenblas-dev
110100
if: ${{ contains(matrix.feature, 'system') }}
111-
- uses: actions-rs/cargo@v1
101+
- name: Install toolchain
102+
uses: dtolnay/rust-toolchain@stable
103+
- name: Test features=${{ matrix.feature }}
104+
run: cargo test --features=${{ matrix.feature }} --manifest-path=openblas-src/Cargo.toml
105+
106+
cross:
107+
name: ${{matrix.target}}
108+
runs-on: ubuntu-latest
109+
strategy:
110+
fail-fast: false
111+
matrix:
112+
feature:
113+
- ""
114+
- static
115+
- system
116+
target:
117+
- aarch64-unknown-linux-gnu
118+
- armv7-unknown-linux-gnueabihf
119+
steps:
120+
- uses: actions/checkout@v4
121+
- name: Install toolchain
122+
uses: dtolnay/rust-toolchain@stable
123+
with:
124+
target: ${{matrix.target}}
125+
- name: Install Cross
126+
uses: taiki-e/install-action@v2
112127
with:
113-
command: test
114-
args: >
115-
--features=${{ matrix.feature }}
116-
--manifest-path=openblas-src/Cargo.toml
128+
tool: cross
129+
- name: Test features=${{ matrix.feature }}
130+
run: cross test --target ${{matrix.target}} --features=${{ matrix.feature }} --manifest-path=openblas-src/Cargo.toml

.github/workflows/rust.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,29 @@ on:
55
branches:
66
- master
77
pull_request: {}
8+
workflow_dispatch: {}
89

910
jobs:
1011
check-format:
1112
runs-on: ubuntu-22.04
1213
steps:
13-
- uses: actions/checkout@v1
14-
- uses: actions-rs/cargo@v1
14+
- uses: actions/checkout@v4
15+
- name: Install toolchain
16+
uses: dtolnay/rust-toolchain@stable
1517
with:
16-
command: fmt
17-
args: -- --check
18+
components: rustfmt
19+
- name: Check format
20+
run: cargo fmt -- --check
1821

1922
clippy:
2023
runs-on: ubuntu-22.04
2124
steps:
22-
- uses: actions/checkout@v1
25+
- uses: actions/checkout@v4
2326
with:
2427
submodules: "true"
25-
- uses: actions-rs/cargo@v1
28+
- name: Install toolchain
29+
uses: dtolnay/rust-toolchain@stable
2630
with:
27-
command: clippy
31+
components: clippy
32+
- name: Check format
33+
run: cargo clippy

Cross.toml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
[target.aarch64-unknown-linux-gnu]
2+
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main"
23
pre-build = [
34
"dpkg --add-architecture $CROSS_DEB_ARCH",
4-
"apt-get update && apt-get --assume-yes install gfortran-aarch64-linux-gnu gcc-aarch64-linux-gnu libssl-dev:$CROSS_DEB_ARCH libssl-dev"
5+
"apt-get update && apt-get --assume-yes install libopenblas-dev:$CROSS_DEB_ARCH libssl-dev"
56
]
67
[target.aarch64-unknown-linux-gnu.env]
78
passthrough = [
89
"OPENBLAS_CC=aarch64-linux-gnu-gcc",
910
"OPENBLAS_HOSTCC=gcc",
1011
"OPENBLAS_FC=aarch64-linux-gnu-gfortran",
11-
"OPENBLAS_TARGET=NEOVERSEN1"
12+
"OPENBLAS_TARGET=ARMV8"
1213
]
14+
15+
[target.armv7-unknown-linux-gnueabihf]
16+
image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:main"
17+
pre-build = [
18+
"dpkg --add-architecture $CROSS_DEB_ARCH",
19+
"apt-get update && apt-get --assume-yes install libopenblas-dev:$CROSS_DEB_ARCH libssl-dev"
20+
]
21+
[target.armv7-unknown-linux-gnueabihf.env]
22+
passthrough = [
23+
"OPENBLAS_CC=armv7-linux-gnueabihf-gcc",
24+
"OPENBLAS_HOSTCC=gcc",
25+
"OPENBLAS_FC=armv7-linux-gnueabihf-gfortran",
26+
"OPENBLAS_TARGET=ARMV7"
27+
]
28+

0 commit comments

Comments
 (0)