Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
cgwalters committed Jan 20, 2025
1 parent 6a699f4 commit d944df3
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,21 @@ jobs:
run: tar -C / -xzvf install.tar
- name: Integration tests
run: env TMPDIR=/var/tmp ./tests/encapsulate.sh
test-build-chunked-oci:
name: "experimental build-chunked-oci tests"
needs: build-c9s
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download build
uses: actions/[email protected]
with:
name: install-c9s.tar
- name: Install
run: tar -xzvf install-c9s.tar
- name: Integration tests
run: cd tests/build-chunked-oci && podman build -v $(pwd)/usr/bin:/ci -t localhost/test .
build-c9s:
name: "Build (c9s)"
runs-on: ubuntu-latest
Expand Down
30 changes: 30 additions & 0 deletions tests/build-chunked-oci/Containerfile.build-chunked-oci
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM quay.io/fedora/fedora-bootc:41 as rootfs
RUN <<EORUN
set -xeuo pipefail
# Remove some high level superfulous stuff
dnf -y remove sos NetworkManager-tui vim nano
# And this only targets VMs, so flush out all firmware
rpm -qa --queryformat=%{NAME} | grep -Fe '-firmware-' | xargs dnf -y remove
# We don't want any python, and we don't need rpm-ostree either.
dnf -y remove python3 rpm-ostree{,-libs}
bootc container lint
EORUN

# This builder image can be anything as long as it has a new enough
# rpm-ostree.
FROM quay.io/fedora/fedora-bootc:rawhide as builder
RUN --mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared \
--mount=from=rootfs,dst=/rootfs <<EORUN
set -xeuo pipefail
# Pull in the binary we just built; if you're doing this locally you'll want
# to e.g. run `podman build -v target/release/rpm-ostree:/ci/rpm-ostree`.
install /ci/rpm-ostree /usr/bin/
rm /buildcontext/out.oci -rf
rpm-ostree experimental compose build-chunked-oci --bootc --format-version=1 \
--rootfs=/rootfs --output /buildcontext/out.oci

FROM oci:./out.oci
# Need to reference builder here to force ordering. But since we have to run
# something anyway, we might as well cleanup after ourselves.
RUN --mount=type=bind,from=builder,src=.,target=/var/tmp \
--mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared rm /buildcontext/out.oci -rf
Empty file added tests/build-chunked-oci/test.sh
Empty file.

0 comments on commit d944df3

Please sign in to comment.