73 lines
1.9 KiB
YAML
73 lines
1.9 KiB
YAML
name: Test the components of it
|
|
|
|
"on":
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
validate:
|
|
name: Validate Packer templates are reasonable
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: Install packer
|
|
uses: ./.github/actions/install_packer/
|
|
- name: Run syntax check
|
|
run: |
|
|
set -exo pipefail
|
|
for vars in distros/*; do
|
|
~/bin/packerio validate -except=upload -var-file=${vars} sources/
|
|
done
|
|
|
|
collect:
|
|
name: Collect all Ansible-related jobs
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
scenarios: ${{ steps.collection.outputs.tox-envs }}
|
|
vagrant: ${{ steps.vagrant.outputs.tox-envs }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
- name: Install dependencies
|
|
run: |
|
|
set -ex
|
|
python -m pip install --upgrade tox
|
|
- name: Collect dependencies
|
|
id: collection
|
|
uses: greg-hellings/tox-list@v1
|
|
with:
|
|
tox-args: --ansible-driver docker --ansible-driver podman --ansible-driver containers
|
|
- id: vagrant
|
|
uses: greg-hellings/tox-list@v1
|
|
with:
|
|
tox-args: --ansible-driver vagrant
|
|
|
|
lint:
|
|
name: Lint Ansible code
|
|
uses: devroles/meta_test/.github/workflows/lint.yml@master
|
|
|
|
vagrant_build:
|
|
name: Ansible tests on VMs
|
|
needs:
|
|
- collect
|
|
uses: devroles/meta_test/.github/workflows/vagrant_build.yml@master
|
|
with:
|
|
scenarios: "${{ needs.collect.outputs.vagrant }}"
|
|
|
|
build:
|
|
name: Ansible tests on containers
|
|
needs:
|
|
- collect
|
|
uses: devroles/meta_test/.github/workflows/container_build.yml@master
|
|
with:
|
|
scenarios: "${{ needs.collect.outputs.scenarios }}"
|