Skip to content

Run autoinstall validation on any PR or push #1

Run autoinstall validation on any PR or push

Run autoinstall validation on any PR or push #1

name: Validate Ubuntu autoinstall YAML Files
on:
push:
pull_request:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install check-jsonschema yamllint
apt-get install -y yq
- name: Lint attended autoinstall.yaml
run: yamllint iso/preseeds/ubuntu/autoinstall.yaml
- name: Lint unattended autoinstall.yaml
run: yamllint iso/preseeds/ubuntu/autoinstall_unattended.yaml
- name: Download JSON schema
run: curl -o schema.json https://raw.githubusercontent.com/canonical/subiquity/main/autoinstall-schema.json
- name: Extract autoinstall properties from YAML files
run: |
yq eval '.autoinstall' iso/preseeds/ubuntu/autoinstall.yaml > attended.yaml
yq eval '.autoinstall' iso/preseeds/ubuntu/autoinstall_unattended.yaml > unattended.yaml
- name: Validate attended autoinstall.yaml
run: |
check-jsonschema --schemafile schema.json attended.yaml
- name: Validate unattended autoinstall.yaml
run: |
check-jsonschema --schemafile schema.json unattended.yaml