Skip to content

skip_changelog(ci): unify and auto discover integration/molecule tests #66

skip_changelog(ci): unify and auto discover integration/molecule tests

skip_changelog(ci): unify and auto discover integration/molecule tests #66

---
name: Full Integration Test
# yamllint disable-line rule:truthy
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
pull_request:
push:
branches:
- "main"
env:
NAMESPACE: grafana
COLLECTION_NAME: grafana
jobs:
ansible-test-sanity:
uses: ./.github/workflows/ansible-test-sanity.yml
with:
ansible-core-versions: '["stable-2.14","stable-2.15","stable-2.16"]'
discover-ansible-tests:
runs-on: ubuntu-latest
outputs:
molecule-tests: ${{ steps.set-tests.outputs.ansible-test-molecule }}
integration-tests: ${{ steps.set-tests.outputs.ansible-test-integration }}
steps:
- name: Check out codebase
uses: actions/checkout@v3
- name: Discover tests
id: set-tests
run: |
echo ansible-test-molecule="[`for x in $(find tests/integration/targets -maxdepth 1 -mindepth 1 -type d -iname "molecule-*" -printf "%f\n");
do echo '{"test":\"'"${x}"'\","name":\"'"${x#*-}\"'"}'; done | tr '\n' ',' | sed '$s/,$//'`]" >> $GITHUB_OUTPUT
echo ansible-test-integration="[`for x in $(find tests/integration/targets -maxdepth 1 -mindepth 1 -type d -not -iname "molecule-*" -printf "%f\n");
do echo '{"test":\"'"${x}"'\","name":\"'"${x}\"'"}'; done | tr '\n' ',' | sed '$s/,$//'`]" >> $GITHUB_OUTPUT
ansible-test-molecule:
uses: ./.github/workflows/ansible-test-integration.yml
needs: discover-ansible-tests
if: needs.discover-ansible-tests.outputs.molecule-tests != '[]'
with:
targets: ${{ needs.discover-ansible-tests.outputs.molecule-tests }}
ansible-core-versions: '["stable-2.14","stable-2.15","stable-2.16"]'
ansible-test-integration:
uses: ./.github/workflows/ansible-test-integration.yml
needs: discover-ansible-tests
if: needs.discover-ansible-tests.outputs.integration-tests != '[]'
with:
targets: ${{ needs.discover-ansible-tests.outputs.integration-tests }}
ansible-core-versions: '["stable-2.14","stable-2.15","stable-2.16"]'
target-python-versions: '["2.7","3.6","3.7","3.8","3.9","3.10","3.11"]'
pre-test-cmd: |

Check failure on line 57 in .github/workflows/full-integration-test.yml

View workflow run for this annotation

GitHub Actions / Full Integration Test

Invalid workflow file

The workflow is not valid. .github/workflows/full-integration-test.yml (Line: 57, Col: 21): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.ANSIBLE_TEST_ORG_NAME
cat <<EOF > tests/integration/integration_config.yml
org_name: ${{ secrets.ANSIBLE_TEST_ORG_NAME }}
grafana_cloud_api_key: ${{ secrets.ANSIBLE_TEST_CLOUD_API_KEY }}
grafana_api_key: ${{ secrets.ANSIBLE_TEST_GRAFANA_API_KEY }}
grafana_url: ${{ secrets.ANSIBLE_GRAFANA_URL }}
test_stack_name: ${{ secrets.ANSIBLE_TEST_CI_STACK }}
EOF