2023-03-03 09:53:02 +01:00
|
|
|
---
|
2022-08-23 15:42:32 +02:00
|
|
|
name: CI Tests
|
2023-03-03 09:53:02 +01:00
|
|
|
|
|
|
|
# yamllint disable-line rule:truthy
|
2022-08-23 15:42:32 +02:00
|
|
|
on:
|
|
|
|
push:
|
2022-10-20 12:53:16 +02:00
|
|
|
branches:
|
|
|
|
- "main"
|
2022-08-23 15:42:32 +02:00
|
|
|
pull_request:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 6 * * *'
|
|
|
|
env:
|
|
|
|
NAMESPACE: grafana
|
|
|
|
COLLECTION_NAME: grafana
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
sanity:
|
2022-11-22 09:30:41 +01:00
|
|
|
name: Sanity (Ⓐ${{ matrix.ansible }})
|
2022-08-23 15:42:32 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-11-22 09:30:41 +01:00
|
|
|
ansible:
|
|
|
|
- stable-2.12
|
|
|
|
- stable-2.13
|
2022-11-22 10:03:57 +01:00
|
|
|
- stable-2.14
|
2022-11-22 09:30:41 +01:00
|
|
|
- devel
|
2022-11-29 06:53:09 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2022-08-23 15:42:32 +02:00
|
|
|
steps:
|
2022-11-22 09:30:41 +01:00
|
|
|
|
|
|
|
- name: Check out code
|
|
|
|
uses: actions/checkout@v3
|
2022-08-23 15:42:32 +02:00
|
|
|
with:
|
2022-11-22 09:30:41 +01:00
|
|
|
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v3
|
|
|
|
with:
|
|
|
|
python-version: '3.10'
|
|
|
|
|
|
|
|
- name: Install ansible-base (${{ matrix.ansible }})
|
|
|
|
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
|
2023-03-03 09:53:02 +01:00
|
|
|
|
2022-11-22 09:30:41 +01:00
|
|
|
- name: Run sanity tests
|
2022-11-24 06:34:47 +01:00
|
|
|
run: ansible-test sanity -v --docker --color --coverage
|
2022-11-22 09:30:41 +01:00
|
|
|
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
2023-03-03 09:53:02 +01:00
|
|
|
|
2022-08-23 15:42:32 +02:00
|
|
|
integration:
|
2022-11-29 06:53:09 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2022-08-29 12:31:26 +02:00
|
|
|
name: Integration (Ⓐ${{ matrix.ansible }}-py${{ matrix.python }})
|
2022-08-23 15:42:32 +02:00
|
|
|
strategy:
|
2022-08-29 12:31:26 +02:00
|
|
|
fail-fast: true
|
2022-08-23 15:42:32 +02:00
|
|
|
max-parallel: 1
|
|
|
|
matrix:
|
|
|
|
ansible:
|
|
|
|
- stable-2.13
|
|
|
|
python:
|
2022-08-29 12:31:26 +02:00
|
|
|
- '3.10'
|
2023-03-03 09:53:02 +01:00
|
|
|
|
2022-08-23 15:42:32 +02:00
|
|
|
steps:
|
|
|
|
- name: Check out code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
2023-03-03 09:53:02 +01:00
|
|
|
|
2022-08-23 15:42:32 +02:00
|
|
|
- name: create integration_config
|
|
|
|
working-directory: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}/tests/integration
|
|
|
|
run: |
|
|
|
|
cat <<EOF > integration_config.yml
|
|
|
|
stack_name: ${{ secrets.ANSIBLE_TEST_STACK_NAME }}
|
|
|
|
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 }}
|
2023-02-08 10:35:28 +01:00
|
|
|
test_stack_name: ${{ secrets.ANSIBLE_TEST_CI_STACK }}
|
2022-08-23 15:42:32 +02:00
|
|
|
EOF
|
2023-03-03 09:53:02 +01:00
|
|
|
|
2022-08-23 15:42:32 +02:00
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
2022-08-29 12:31:26 +02:00
|
|
|
python-version: ${{ matrix.python }}
|
2022-08-23 15:42:32 +02:00
|
|
|
|
|
|
|
- name: Install ansible-base (${{ matrix.ansible }})
|
|
|
|
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
|
|
|
|
|
|
|
|
- name: Run integration test
|
2022-11-24 06:34:47 +01:00
|
|
|
run: ansible-test integration -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker
|
2022-11-22 08:58:57 +01:00
|
|
|
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|