Skip to content

Commit d4d494d

Browse files
committed
Test on alpine linux for musl
1 parent b57be94 commit d4d494d

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,36 +272,60 @@ jobs:
272272
- name: Run tests
273273
run: cargo test --workspace --all-targets --release
274274

275-
build-and-test-fedora:
275+
build-and-test-container:
276+
strategy:
277+
matrix:
278+
os: ["fedora", "alpine"]
276279
runs-on: ubuntu-latest
277-
container: fedora:latest
280+
container: "${{ matrix.os }}:latest"
278281

279282
steps:
280283
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
281284

282-
- name: Install dependencies
285+
- name: Install dependencies (fedora)
286+
if: matrix.os == 'fedora'
283287
run: |
284288
dnf install -y cargo pam-devel
285289
290+
- name: Install dependencies (alpine)
291+
if: matrix.os == 'alpine'
292+
run: |
293+
apk add cargo linux-pam-dev sudo tzdata coreutils-fmt
294+
286295
- name: Rust Cache
287296
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
288297
with:
289-
shared-key: "stable-fedora"
298+
shared-key: "stable-${{matrix.os}}"
290299

291300
- name: Register rust problem matcher
292301
run: echo "::add-matcher::.github/problem-matchers/rust.json"
293302

294-
- name: Reduce privileges
303+
- name: Reduce privileges (fedora)
304+
if: matrix.os == 'fedora'
295305
run: |
296306
useradd builder
297307
chown builder .
298308
309+
- name: Reduce privileges (alpine)
310+
if: matrix.os == 'alpine'
311+
run: |
312+
adduser --disabled-password builder
313+
chown builder .
314+
299315
- name: Build
300316
run: sudo -ubuilder cargo build --workspace --all-targets --release
301317

302-
- name: Run tests
318+
- name: Run tests (not alpine)
319+
if: matrix.os != 'alpine'
303320
run: sudo -ubuilder cargo test --workspace --all-targets --release
304321

322+
- name: Run tests (alpine)
323+
if: matrix.os == 'alpine'
324+
run: |
325+
# Alpine hasn't done usr-merge yet
326+
sudo -ubuilder cargo test --workspace --all-targets --release \
327+
-- --skip canonicalization --skip test_build_run_context
328+
305329
build-and-test-32bit:
306330
runs-on: ubuntu-latest
307331

0 commit comments

Comments
 (0)