grafana-ansible-collection/.github/workflows/ci-test.yml
Ishan Jain c718a25d7d
Add Integration tests for the modules
* add integration tests

* add tests

* add checkout

* check cat of the file

* updatng tests

* rename folder

* update action

* test str api key

* update config file name

* updated versions for tests

* updated action

* updated action

* update test

* updated ytests

* updated check

* Delete play.yml

* updated check

* update delete test

* updated conditional check

* updated check

* updated tests

* updated tests

* Updated tests

* Add folder test

* fail test

* updated tests

* updated tests

* update tests

* add cloud stack test

* update stack test

* update test

* update test

* update test

* update test

* update test

* update test

* update tests

* update tests

* updated test

* add plugin test

* updated tests

* add api key test

* updat etest

* updated tests

* add notification policy tree test

* reorg

* fix

* fix

* update

* add contact point test

* update action

* Seperate actions

* update action name

* update action

* update action

* update seq number

* Updating CI tests

* Edit Actions
2022-08-23 19:12:32 +05:30

88 lines
2.8 KiB
YAML

name: CI Tests
on:
push:
pull_request:
schedule:
- cron: '0 6 * * *'
env:
NAMESPACE: grafana
COLLECTION_NAME: grafana
jobs:
sanity:
name: Sanity (Ⓐ${{ matrix.ansible }})
strategy:
matrix:
ansible:
- stable-2.10
- stable-2.11
- stable-2.12
- devel
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- 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 sanity tests
run: ansible-test sanity --docker -v --color --coverage
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- name: Generate coverage report
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
integration:
runs-on: ubuntu-latest
name: Integration ${{ matrix.ansible }}-py${{ matrix.python }})
strategy:
fail-fast: false
max-parallel: 1
matrix:
ansible:
- stable-2.13
python:
- '3.9'
steps:
- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- 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 }}
EOF
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- 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
run: ansible-test integration -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --docker --coverage
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}