Skip to content

Commit 3af092d

Browse files
committed
use targets as strat
1 parent 563e650 commit 3af092d

File tree

1 file changed

+15
-41
lines changed

1 file changed

+15
-41
lines changed

.github/workflows/rust.yml

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,63 +10,37 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13-
ubuntu-linux-amd64-build:
13+
ubuntu-build:
1414
runs-on: ubuntu-latest
1515

16-
steps:
17-
- uses: actions/checkout@v4
18-
- name: Cache dependencies
19-
uses: Swatinem/rust-cache@v2.7.3
20-
- name: Build
21-
run: cargo build --release --verbose
22-
- name: Artefacts
23-
uses: actions/upload-artifact@v4
24-
with:
25-
name: cloudflareddns-${{ runner.os }}-${{ runner.arch }}
26-
path: |
27-
target/**/cloudflareddns
28-
LICENSE
29-
README.md
30-
31-
ubuntu-linux-arm64-build:
32-
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-musl, x86_64-pc-windows-gnu]
3319

3420
steps:
3521
- uses: actions/checkout@v4
22+
3623
- name: Cache dependencies
3724
uses: Swatinem/rust-cache@v2.7.3
38-
- uses: actions-rs/cargo@v1
25+
26+
- name: Build for ${{ matrix.target }}
27+
if: matrix.target != 'x86_64-unknown-linux-gnu'
28+
uses: actions-rs/cargo@v1
3929
with:
4030
use-cross: true
4131
command: build
42-
args: --all --release --target=aarch64-unknown-linux-musl
43-
- name: Artefacts
44-
uses: actions/upload-artifact@v4
45-
with:
46-
name: cloudflareddns-${{ runner.os }}-arm64
47-
path: |
48-
target/**/cloudflareddns
49-
LICENSE
50-
README.md
32+
args: --all --release --target=${{ matrix.target }}
5133

52-
ubuntu-windows-amd64-build:
53-
runs-on: ubuntu-latest
34+
- name: Build for ${{ matrix.target }}
35+
if: matrix.target == 'x86_64-unknown-linux-gnu'
36+
run: cargo build --release --verbose
5437

55-
steps:
56-
- uses: actions/checkout@v4
57-
- name: Cache dependencies
58-
uses: Swatinem/rust-cache@v2.7.3
59-
- uses: actions-rs/cargo@v1
60-
with:
61-
use-cross: true
62-
command: build
63-
args: --all --release --target=x86_64-pc-windows-gnu
6438
- name: Artefacts
6539
uses: actions/upload-artifact@v4
6640
with:
67-
name: cloudflareddns-windows-${{ runner.arch }}
41+
name: cloudflareddns-${{ matrix.target }}
6842
path: |
69-
target/**/cloudflareddns
43+
target/**/cloudflareddns*
7044
LICENSE
7145
README.md
7246

0 commit comments

Comments
 (0)