Add new `org.osbuild.cloud-init` stage, which currently allows to create configuration files for cloud-init under `/etc/cloud/cloud.cfg.d`. The stage supports only a very limited subset of cloud-init configuration options, which is covering needs of RHEL AMI images. The schema mandates that if the 'configuration_files' option is specified, then at least one configuration file must be defined. In addition each section of the configuration must contain at least one property (section or configuration option). Add `python3-pyyaml` package to the `F34-build` testing manifest, because it is required for running and testing the new stage. Regenerate all affected manifests. Add test for the new stage. Update the `osbuild-ci` container image used for testing to a new tag, which includes python3-pyyaml, the dependency of the new stage. Signed-off-by: Tomas Hozza <thozza@redhat.com>
131 lines
3.5 KiB
YAML
131 lines
3.5 KiB
YAML
name: Tests
|
|
|
|
on: [pull_request, push]
|
|
|
|
jobs:
|
|
test_suite:
|
|
name: "Test Suite"
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
test:
|
|
- "test.mod"
|
|
- "test.run.test_assemblers"
|
|
- "test.run.test_boot"
|
|
- "test.run.test_noop"
|
|
- "test.run.test_ostree"
|
|
- "test.run.test_sources"
|
|
- "test.run.test_stages"
|
|
- "test.src"
|
|
steps:
|
|
- name: "Clone Repository"
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 2 # codecov requires this (https://github.com/codecov/codecov-action/issues/190)
|
|
- name: "Run Tests"
|
|
uses: osbuild/containers/src/actions/privdocker@e4de123f43b95e99dfe8eed0bd5a1cd58db50715
|
|
with:
|
|
image: ghcr.io/osbuild/osbuild-ci:latest-202106231345
|
|
run: |
|
|
python3 -m pytest \
|
|
--pyargs "${{ matrix.test }}" \
|
|
--rootdir=. \
|
|
--cov-report=xml --cov=osbuild \
|
|
-v
|
|
- name: Send coverage to codecov.io
|
|
run: bash <(curl -s https://codecov.io/bash)
|
|
|
|
documentation:
|
|
name: "📚 Documentation"
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: docker.io/library/python:3.7
|
|
steps:
|
|
- name: Install Dependencies
|
|
run: |
|
|
pip install docutils
|
|
|
|
- name: Clone repository
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: osbuild
|
|
|
|
- name: Generate Documentation
|
|
run: |
|
|
make \
|
|
-f osbuild/Makefile \
|
|
SRCDIR=osbuild \
|
|
BUILDDIR=build \
|
|
RST2MAN=rst2man.py \
|
|
man
|
|
|
|
- name: Verify Documentation
|
|
working-directory: build
|
|
run: |
|
|
test -d docs
|
|
test -f docs/osbuild.1
|
|
|
|
sample_validation:
|
|
name: "sample validation"
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: docker.io/library/python:3.7
|
|
steps:
|
|
- name: Clone repository
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: osbuild
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
pip install jsonschema
|
|
|
|
- name: Validate the samples
|
|
run: |
|
|
cd osbuild
|
|
for f in samples/*; do
|
|
python3 -m osbuild --libdir . --inspect "$f" > /dev/null
|
|
done
|
|
|
|
test_data:
|
|
name: "Regenerate Test Data"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Clone Repository"
|
|
uses: actions/checkout@v2
|
|
- name: "Regenerate Test Data"
|
|
uses: osbuild/containers/src/actions/privdocker@e4de123f43b95e99dfe8eed0bd5a1cd58db50715
|
|
with:
|
|
image: ghcr.io/osbuild/osbuild-ci:latest-202102191311
|
|
run: |
|
|
make test-data
|
|
git diff --exit-code -- ./test/data
|
|
|
|
codespell:
|
|
name: "Spell check"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: codespell-project/actions-codespell@master
|
|
with:
|
|
ignore_words_list: msdos
|
|
skip: ./.git,coverity,rpmbuild,samples
|
|
|
|
schutzbot:
|
|
name: "🍌 Trigger Schutzbot"
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: docker.io/library/python:3.7
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Trigger Schutzbot
|
|
env:
|
|
EVENT_NAME: ${{ github.event_name }}
|
|
WEBHOOK_PAYLOAD: ${{ toJSON(github.event) }}
|
|
SQS_REGION: us-east-1
|
|
SQS_QUEUE_URL: "https://sqs.us-east-1.amazonaws.com/933752197999/schutzbot_webhook_sqs-staging"
|
|
run: |
|
|
#!/bin/bash
|
|
pip3 install boto3 botocore
|
|
schutzbot/send_webhook.py
|