diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..a80c0eb --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,41 @@ +name: Ansible Integration Test Runner + +on: + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '*/15 * * * *' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install ansible + run: | + python -m pip install --upgrade pip + pip install ansible + - name: Build and install collection + run: | + ansible-galaxy collection build . + ansible-collection install *.gz + - name: Add service account file + env: + SERVICE_ACCOUNT_FILE: ${{ secrets.SERVICE_ACCOUNT_FILE }} + run: | + echo $SERVICE_ACCOUNT_FILE > /tmp/service_account.json + - name: Add test template + env: + TEST_SETTINGS_TEMPLATE: ${{ secrets.TEST_SETTINGS_TEMPLATE }} + run: | + pushd ~/.ansible/collections/ansible_collections/google/cloud + echo $TEST_SETTINGS_TEMPLATE > tests/integration/cloud-config-gcp.ini + - name: Run the tests + run: | + pushd ~/.ansible/collections/ansible_collections/google/cloud + ansible-test integration -v --allow-unsupported --continue-on-error $(find tests/integration/targets -name "gcp*" -type d -printf "%P ")