Use the images provided by `osbuild/containers` tagged as GHCI (GitHub CI). These images are fully under our control, cached on the GitHub infrastructure, and prepared to run `systemd-nspawn` and friends in a docker container. The GHCI infrastructure is versioned. New updates to the CI infrastructure are not automatically picked up. Instead, the `v1` tag has to be explicitly redirected to new image builds to deploy them. If a new deployment causes CI failures, we can simply redirect the `v1` tag back to the previous image builds and get the previous behavior back. The `osbuild/containers` repository contains the required infrastructure for this logic. If new dependencies are required in the CI environment, the respective Dockerfiles must be updated. As a temporary workaround (e.g., as part of a PR that introduces this), you can simply add `dnf install -y <package>` to the required entries in `.github/workflows/*`.
93 lines
2.4 KiB
YAML
93 lines
2.4 KiB
YAML
name: Runtime Tests
|
|
|
|
on: [pull_request, push]
|
|
|
|
#
|
|
# We set `PYTHONUNBUFFERED` to get more immediate and ordered output from
|
|
# python programs. This should not be necessary if all relevant output used the
|
|
# unbuffered stderr, but that is not entirely under our control.
|
|
#
|
|
env:
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
jobs:
|
|
runtime_tests:
|
|
name: "Runtime Pipeline Execution Tests"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Clone Repository"
|
|
uses: actions/checkout@v2
|
|
- name: "Run Pipeline Tests"
|
|
uses: osbuild/containers/ghci/actions/ghci-osbuild@ghci/v1
|
|
with:
|
|
run: make test-runtime
|
|
|
|
noop_pipeline_tests:
|
|
name: "Noop-Pipeline Tests"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Clone Repository"
|
|
uses: actions/checkout@v2
|
|
- name: "Install Dependencies"
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get -y install \
|
|
systemd-container
|
|
- name: "Set up Python"
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.7
|
|
- name: Install Python Packages
|
|
run: pip install jsonschema
|
|
- name: "Run Noop-Pipeline Tests"
|
|
run: |
|
|
for i in {0..2} ; do
|
|
sudo env "PATH=$PATH" python3 -m osbuild --libdir . samples/noop.json
|
|
done
|
|
|
|
assembler_tests:
|
|
name: "Assembler Tests"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Clone Repository"
|
|
uses: actions/checkout@v2
|
|
- name: "Install Dependencies"
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get -y install \
|
|
nbd-client \
|
|
qemu-utils \
|
|
rpm \
|
|
systemd-container \
|
|
tar \
|
|
yum
|
|
- name: "Set up Python"
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.7
|
|
- name: Install Python Packages
|
|
run: pip install jsonschema
|
|
- name: "Run Assembler Tests"
|
|
run: sudo env "PATH=$PATH" python3 -m unittest -v test.test_assemblers
|
|
|
|
stage_tests:
|
|
name: "Stage Tests"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Clone Repository"
|
|
uses: actions/checkout@v2
|
|
- name: "Install Dependencies"
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get -y install \
|
|
systemd-container \
|
|
tar \
|
|
yum
|
|
- name: "Set up Python"
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.7
|
|
- name: Install Python Packages
|
|
run: pip install jsonschema
|
|
- name: "Run Stage Tests"
|
|
run: sudo env "PATH=$PATH" python3 -m unittest -v test.test_stages
|