48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: Test the components of it
|
|
|
|
"on":
|
|
push:
|
|
paths-ignore:
|
|
- .github/workflow/build.yml
|
|
- http/**
|
|
- README.box.md
|
|
- README.md
|
|
- LICENSE
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
validate:
|
|
name: Validate Packer templates are reasonable
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: ./.github/actions/setup
|
|
- uses: ./.github/actions/install_packer
|
|
- name: Run syntax check
|
|
run: |
|
|
set -exo pipefail
|
|
for vars in $(find distros/ -name '*.pkrvars.hcl'); do
|
|
if [[ "${vars}" == *.sh ]]; then
|
|
"./${vars}"
|
|
vars=${vars%.sh}
|
|
fi
|
|
packer validate -except=upload -var-file=${vars} sources/
|
|
done
|
|
|
|
lint:
|
|
name: Lint Ansible code
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
- name: Setup test environment
|
|
uses: ./.github/actions/setup
|
|
with:
|
|
ansible: true
|
|
- name: Run lint
|
|
run: |
|
|
yamllint -c ansible/yamllint.yml ansible .github distros
|
|
find distros/ -name user-data | xargs yamllint -c ansible/yamllint.yml
|
|
# TODO: Add ansible-lint run
|