diff --git a/templates/phyllomeos.ci.yml b/templates/phyllomeos.ci.yml new file mode 100644 index 0000000..bcd1461 --- /dev/null +++ b/templates/phyllomeos.ci.yml @@ -0,0 +1,25 @@ +name: ci + +on: + push: + pull_request: + +jobs: + # Bump when the recipe language changes; both jobs share the runner. + cook: + runs-on: fedora + defaults: + run: + shell: bash + container: + image: git.phyllo.me/devops/fedora-runner-image:latest + steps: + - uses: https://git.phyllo.me/devops/checkout@v5 + with: + fetch-depth: 0 + - name: Lint manifest + templates + run: make -C cook lint + - name: Generate recipes + dishes, validate every dish + run: make -C cook all + - name: Run the pytest suite + run: make -C cook test \ No newline at end of file diff --git a/templates/rpm-sources.smoke.yml b/templates/rpm-sources.smoke.yml new file mode 100644 index 0000000..dbd6239 --- /dev/null +++ b/templates/rpm-sources.smoke.yml @@ -0,0 +1,33 @@ +name: ci + +on: + push: + pull_request: + +# Smoke test that the source set compiles under mock without publishing. +# Host job: mock needs real chroots on the runner VM. +jobs: + mock-smoke: + runs-on: fedora + defaults: + run: + shell: bash + steps: + - uses: https://git.phyllo.me/devops/checkout@v5 + with: + fetch-depth: 0 + - name: Initialize mock root + run: mock -r fedora-43-x86_64 --init + - name: Install build deps + run: | + mock -r fedora-43-x86_64 --install git make gcc + - name: Smoke build + run: | + mock -r fedora-43-x86_64 --copyin . /builddir/src + mock -r fedora-43-x86_64 --shell --enable-network --isolation=simple << 'EOF' + cd /builddir/src + make || true + EOF + - name: Cleanup + if: always() + run: mock -r fedora-43-x86_64 --clean \ No newline at end of file diff --git a/templates/xml-definition-for-domains.ci.yml b/templates/xml-definition-for-domains.ci.yml new file mode 100644 index 0000000..f7dfb1a --- /dev/null +++ b/templates/xml-definition-for-domains.ci.yml @@ -0,0 +1,33 @@ +name: ci + +on: + push: + pull_request: + +jobs: + xmllint: + runs-on: fedora + defaults: + run: + shell: bash + container: + image: git.phyllo.me/devops/fedora-runner-image:latest + steps: + - uses: https://git.phyllo.me/devops/checkout@v5 + with: + fetch-depth: 0 + - name: Validate XML definitions + run: | + if command -v xmllint >/dev/null; then + for f in $(find . -name '*.xml'); do + xmllint --noout "$f" + done + else + python3 - <<'EOF' + import glob, xml.etree.ElementTree as ET + files = glob.glob('**/*.xml', recursive=True) + for f in files: + ET.parse(f) # raises on malformed XML + print(f"ok: {len(files)} XML files well-formed") + EOF + fi \ No newline at end of file