Skip to content

Commit a7384f2

Browse files
authored
Enable pid1 tests (#10)
* Enable pid1 tests Switches to Ubuntu image since alpine interacts badly with github runner where it gets stuck waiting for the output to be available. * Use ubuntu for the other image too * Reorder cache * Use --interactive option
1 parent 4b49849 commit a7384f2

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

.github/workflows/rust.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ jobs:
3636
- uses: extractions/setup-just@v1
3737
with:
3838
just-version: 1.10.0
39+
- uses: Swatinem/rust-cache@v2
40+
with:
41+
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-${{ matrix.toolchain }}
3942
- uses: dtolnay/rust-toolchain@master
4043
with:
4144
toolchain: ${{ matrix.toolchain }}
4245
components: clippy, rustfmt
43-
- uses: Swatinem/rust-cache@v2
44-
with:
45-
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-${{ matrix.toolchain }}
4646
- name: Install musl tools
4747
run: |
4848
sudo apt-get install -y musl-tools
@@ -53,9 +53,11 @@ jobs:
5353
- name: Run tests
5454
run: |
5555
just test
56-
# just test-init-image
5756
cd pid1 && just test
5857
if: runner.os == 'Linux'
58+
- name: Run pid1 tests
59+
run: just test-init-image
60+
if: runner.os == 'Linux'
5961
- name: clippy
6062
run: cargo clippy -- --deny "warnings"
6163
- name: fmt

justfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ test: build-release-binary
1313

1414
# Test docker image
1515
test-init-image:
16-
docker run --rm --name pid --interactive pid1runner ps aux
17-
docker run --rm --name pid --interactive pid1runner ls
18-
docker run --rm --name pid --interactive pid1runner ls /
19-
docker run --rm --name pid --interactive pid1runner id
20-
docker run --rm --name pid --interactive pid1runner --workdir=/home pwd
21-
docker run --rm --name pid --interactive pid1runner --env HELLO=WORLD --env=FOO=BYE printenv HELLO FOO
16+
docker run --rm --interactive --name pid pid1runner ps aux
17+
docker run --rm --interactive --name pid pid1runner ls
18+
docker run --rm --interactive --name pid pid1runner ls /
19+
docker run --rm --interactive --name pid pid1runner id
20+
docker run --rm --interactive --name pid pid1runner --workdir=/home pwd
21+
docker run --rm --interactive --name pid pid1runner --env HELLO=WORLD --env=FOO=BYE printenv HELLO FOO
2222

2323
# Exec init image
2424
exec-init-image:

pid1-exe/etc/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.18.4
1+
FROM ubuntu:22.04
22

33
COPY pid1 /usr/bin/pid1
44

pid1/etc/Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
FROM alpine
2-
3-
RUN apk update && apk add coreutils procps
1+
FROM ubuntu:22.04
42

53
COPY simple /simple
64

0 commit comments

Comments
 (0)