Skip to content

fixup! Enable Github workflow for basic deployment role testing #7

fixup! Enable Github workflow for basic deployment role testing

fixup! Enable Github workflow for basic deployment role testing #7

---
name: Test collection roles
on:
- push
- pull_request
jobs:
check_roles:
name: Verify modified roles
runs-on: ubuntu-latest
outputs:
ipaserver: ${{ steps.mod_files.outputs.ipaserver }}
ipareplica: ${{ steps.mod_files.outputs.ipareplica }}
ipaclient: ${{ steps.mod_files.outputs.ipaclient }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 1
- name: Check modified roles
id: mod_files
shell: bash
run: |
set -eu
git remote add upstream https://github.com/freeipa/ansible-freeipa
git fetch --depth 1 upstream master
git diff -M --name-only upstream/master \
| grep "^roles" \
| cut -d/ -f2 \
| sort | uniq \
| sed "s/\(.*\)/\1=true/"
echo "ipaserver='false'" >> $GITHUB_OUTPUT
echo "ipareplica='false'" >> $GITHUB_OUTPUT
echo "ipaclient='false'" >> $GITHUB_OUTPUT
git diff -M --name-only upstream/master \
| grep "^roles" \
| cut -d/ -f2 \
| sort | uniq \
| sed "s/\(.*\)/\1='true'/" >> $GITHUB_OUTPUT
test_ipaserver:
name: Test ipaserver role
needs: [check_roles]
if: ${{ needs.check_roles.outputs.ipaserver == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Test ipaserver
run: |
echo "testing ipaserver"
test_ipareplica:
name: Test ipareplica role
needs: [check_roles]
if: ${{ needs.check_roles.outputs.ipareplica == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Test ipareplica
run: |
echo "testing ipareplica"