Skip to content

Commit 939581e

Browse files
committed
feat: update github actions configuration
1 parent 3fae269 commit 939581e

2 files changed

Lines changed: 22 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,36 @@ on:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
workflow_call:
89

910
env:
1011
CARGO_TERM_COLOR: always
1112
RUST_BACKTRACE: 1
1213

1314
jobs:
14-
ci:
15-
name: Build, Lint & Test
15+
lint:
16+
name: Lint & Format
1617
runs-on: ubuntu-latest
1718
steps:
1819
- uses: actions/checkout@v6
1920
- uses: dtolnay/rust-toolchain@stable
2021
with:
2122
components: rustfmt, clippy
23+
- name: Check formatting
24+
run: cargo fmt --all -- --check
25+
- name: Clippy
26+
run: cargo clippy --all-targets -- -D warnings
27+
28+
test:
29+
name: Test (${{ matrix.os }})
30+
runs-on: ${{ matrix.os }}
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os: [ubuntu-latest, macos-latest]
35+
steps:
36+
- uses: actions/checkout@v6
37+
- uses: dtolnay/rust-toolchain@stable
2238
- uses: actions/cache@v5
2339
with:
2440
path: |
@@ -27,12 +43,7 @@ jobs:
2743
target
2844
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
2945
restore-keys: ${{ runner.os }}-cargo-
30-
3146
- name: Build
3247
run: cargo build --quiet
33-
- name: Check formatting
34-
run: cargo fmt --all -- --check
35-
- name: Clippy
36-
run: cargo clippy --all-targets -- -D warnings
3748
- name: Unit tests
3849
run: cargo test

.github/workflows/release.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ env:
1515
CARGO_TERM_COLOR: always
1616

1717
jobs:
18+
ci:
19+
uses: ./.github/workflows/ci.yml
20+
1821
build:
1922
name: Build (${{ matrix.target }})
23+
needs: ci
2024
runs-on: ${{ matrix.os }}
2125
strategy:
2226
fail-fast: false
@@ -51,12 +55,6 @@ jobs:
5155
sudo apt-get update
5256
sudo apt-get install -y musl-tools gcc-aarch64-linux-gnu
5357
54-
- name: Test
55-
env:
56-
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc
57-
run: |
58-
cargo test --workspace --target ${{ matrix.target }}
59-
6058
- name: Build
6159
env:
6260
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc

0 commit comments

Comments
 (0)