54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
name: Validate DAGs
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- 'app-configs/rinoa/dagu/dags/**'
|
|
- '**/dag-config-check.yml'
|
|
branches-ignore:
|
|
- main
|
|
|
|
env:
|
|
DAGS_PATH: "app-configs/rinoa/dagu/dags"
|
|
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
|
|
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Ansible
|
|
uses: alex-oleshkevich/setup-ansible@v1.0.1
|
|
with:
|
|
version: "11.4.0"
|
|
|
|
- name: Set up Vault CLI
|
|
uses: eLco/setup-vault@v1
|
|
with:
|
|
vault_version: 1.18.0
|
|
|
|
- name: Install hvac (Vault Python SDK)
|
|
run: pip install hvac
|
|
|
|
- name: Render .yaml.j2 templates
|
|
uses: dawidd6/action-ansible-playbook@v2
|
|
with:
|
|
directory: .
|
|
vault_password: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}
|
|
requirements: collections/requirements.yml
|
|
playbook: playbooks/rinoa-render-dags.yml
|
|
|
|
- name: Install dagu
|
|
run: |
|
|
curl -L https://raw.githubusercontent.com/dagu-org/dagu/main/scripts/installer.sh | bash
|
|
|
|
- name: Validate DAGs
|
|
run: |
|
|
for dag in $(find ${DAGS_PATH} -type f -name "*.yaml" -a ! -name "*example*"); do
|
|
echo "Validating ${dag}..."
|
|
dagu dry "${dag}"
|
|
done
|