Skip to content

Commit 639f595

Browse files
authored
refactor ci and add macos compilation test (#15)
1 parent 8414dfd commit 639f595

File tree

1 file changed

+15
-30
lines changed

1 file changed

+15
-30
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,30 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717
- name: Set up Rust
1818
uses: dtolnay/rust-toolchain@v1
1919
with:
2020
toolchain: stable
21+
components: rustfmt, clippy
2122
- name: Run cargo check
23+
if: success() || failure()
2224
run: cargo check
25+
- name: Check code formatting
26+
if: success() || failure()
27+
run: cargo fmt -- --check
28+
- name: Run Clippy
29+
if: success() || failure()
30+
run: cargo clippy -- --deny warnings
2331

24-
test:
25-
runs-on: ubuntu-latest
32+
testing:
33+
strategy:
34+
matrix:
35+
os: [ubuntu-latest, macos-latest]
36+
runs-on: ${{ matrix.os }}
2637
steps:
2738
- name: Checkout repository
28-
uses: actions/checkout@v2
39+
uses: actions/checkout@v4
2940
- name: Set up Rust
3041
uses: dtolnay/rust-toolchain@v1
3142
with:
@@ -34,29 +45,3 @@ jobs:
3445
run: cargo install cargo-expand
3546
- name: Run cargo test
3647
run: cargo test --verbose
37-
38-
fmt:
39-
runs-on: ubuntu-latest
40-
steps:
41-
- name: Checkout repository
42-
uses: actions/checkout@v2
43-
- name: Set up Rust
44-
uses: dtolnay/rust-toolchain@v1
45-
with:
46-
toolchain: stable
47-
components: rustfmt
48-
- name: Check code formatting
49-
run: cargo fmt -- --check
50-
51-
clippy:
52-
runs-on: ubuntu-latest
53-
steps:
54-
- name: Checkout repository
55-
uses: actions/checkout@v2
56-
- name: Set up Rust
57-
uses: dtolnay/rust-toolchain@v1
58-
with:
59-
toolchain: stable
60-
components: clippy
61-
- name: Run Clippy
62-
run: cargo clippy -- --deny warnings

0 commit comments

Comments
 (0)