Skip to content

Commit baf369e

Browse files
committed
Test
1 parent 6a30fe8 commit baf369e

2 files changed

Lines changed: 34 additions & 11 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2023-2024 Daniel Mueller <deso@posteo.net>
1+
# Copyright (C) 2023-2025 Daniel Mueller <deso@posteo.net>
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

44
name: Build
@@ -17,24 +17,29 @@ jobs:
1717
build:
1818
name: Build statically linked binary
1919
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
# Please update the test workflow cross-compile matrix when adding a new
23+
# target here.
24+
target: [
25+
armv7-unknown-linux-musleabihf,
26+
x86_64-unknown-linux-musl,
27+
]
2028
steps:
2129
- uses: actions/checkout@v5
22-
- name: Install dependencies
23-
run: sudo apt-get install --yes --no-install-recommends musl-tools
24-
- uses: dtolnay/rust-toolchain@stable
30+
- uses: taiki-e/setup-cross-toolchain-action@v1
2531
with:
26-
target: x86_64-unknown-linux-musl
32+
target: ${{ matrix.target }}
2733
- run: |
28-
CARGO_PROFILE_RELEASE_DEBUG=false CARGO_PROFILE_RELEASE_STRIP=true cargo install --bin=btrfs-backup --path=. --root=. --target x86_64-unknown-linux-musl
29-
strip bin/btrfs-backup
34+
CARGO_PROFILE_RELEASE_DEBUG=false CARGO_PROFILE_RELEASE_STRIP=true cargo install --bin=btrfs-backup --path=. --root=. --target ${{ matrix.target }}
3035
- uses: actions/upload-artifact@v4
3136
with:
32-
name: btrfs-backup
37+
name: btrfs-backup-${{ matrix.target }}
3338
path: bin/btrfs-backup
3439
- if: ${{ inputs.upload-release != '' }}
3540
name: Upload release asset
3641
env:
3742
GH_TOKEN: ${{ github.token }}
3843
run: |
39-
mv bin/btrfs-backup btrfs-backup
40-
gh release upload ${{ inputs.upload-release }} btrfs-backup
44+
mv bin/btrfs-backup btrfs-backup-${{ matrix.target }}
45+
gh release upload ${{ inputs.upload-release }} btrfs-backup-${{ matrix.target }}

.github/workflows/test.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2023-2024 Daniel Mueller <deso@posteo.net>
1+
# Copyright (C) 2023-2025 Daniel Mueller <deso@posteo.net>
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

44
name: Test
@@ -37,6 +37,24 @@ jobs:
3737
run: |
3838
cargo build --profile=${{ matrix.profile }} --all-features --bins --tests
3939
cargo test --profile=${{ matrix.profile }} --all-features
40+
build-cross:
41+
name: Cross-compile [${{ matrix.target }}]
42+
runs-on: ubuntu-latest
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
# Please update the build workflow cross-compile matrix when
47+
# adding a new target here.
48+
target: [
49+
armv7-unknown-linux-musleabihf,
50+
x86_64-unknown-linux-musl,
51+
]
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: taiki-e/setup-cross-toolchain-action@v1
55+
with:
56+
target: ${{ matrix.target }}
57+
- run: cargo build
4058
clippy:
4159
name: Lint with clippy
4260
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)