initial
Some checks failed
Infrastructure / Check infrastructure definitions (pull_request) Failing after 1m31s
Some checks failed
Infrastructure / Check infrastructure definitions (pull_request) Failing after 1m31s
This commit is contained in:
45
.github/workflows/infra.yaml
vendored
Normal file
45
.github/workflows/infra.yaml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Infrastructure
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- infra/**
|
||||
paths:
|
||||
- infra/**-playbook.yaml
|
||||
- .github/workflows/infra.yaml
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Check infrastructure definitions
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install dependencies
|
||||
run: -|
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip3 install -r requirements.txt
|
||||
ansible-galaxy collection install community.general
|
||||
|
||||
- name: Get changed playbooks
|
||||
id: changed-playbooks
|
||||
uses: tj-actions/changed-files@v38
|
||||
with:
|
||||
files: infra/**-playbook.yaml
|
||||
|
||||
- name: Check modified playbooks
|
||||
run: -|
|
||||
for file in ${{ steps.changed-playbooks.outputs.all_changed_files }}; do
|
||||
ansible --inventory ./inventory --check "$file"
|
||||
done
|
Reference in New Issue
Block a user