Skip to content

Sumac support

Sumac support #209

name: Integration Test
on:
pull_request:
push:
branches:
- main
jobs:
load-roles:
runs-on: ubuntu-latest
outputs:
roles: ${{ steps.changed_roles.outputs.roles }}
scenarios: ${{ steps.scenarios.outputs.scenarios}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Find changed roles
id: changed_roles
run: |
ROLES=$(git diff --name-only origin/${{ github.base_ref || 'main~' }} -- roles/*/ | awk -F '/' '{print $2}' | uniq | jq -R -s -c 'split("\n")[:-1]')
echo "roles=$ROLES" >> $GITHUB_OUTPUT
- name: Find available scenarios
id: scenarios
run: |
SCENARIOS=$(ls molecule | jq -R -s -c 'split("\n")[:-1]')
echo "scenarios=$SCENARIOS" >> $GITHUB_OUTPUT
linter:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install test dependencies
run: make dev-requirements
- name: Run linter
run: make quality
molecule:
if: ${{ needs.load-roles.outputs.roles != '[]' && needs.load-roles.outputs.roles != '' }}
needs: load-roles
strategy:
fail-fast: false
matrix:
environment: ${{ fromJson(needs.load-roles.outputs.roles) }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install test dependencies
run: make dev-requirements
- name: Run molecule tests
if: ${{ contains(fromJson(needs.load-roles.outputs.scenarios), matrix.environment) }}
run: molecule test -s ${{ matrix.environment }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLORS: '1'