2022-10-20 12:53:16 +02:00
|
|
|
name: GitHub Release
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
description: 'Version number to release'
|
|
|
|
required: true
|
|
|
|
env:
|
|
|
|
NAMESPACE: grafana
|
|
|
|
COLLECTION_NAME: grafana
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
sanity:
|
|
|
|
name: Sanity (Ⓐ${{ matrix.ansible }})
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
ansible:
|
|
|
|
- stable-2.12
|
|
|
|
- stable-2.13
|
2022-11-22 10:56:49 +01:00
|
|
|
- stable-2.14
|
2022-10-20 12:53:16 +02:00
|
|
|
- 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.10'
|
|
|
|
|
|
|
|
- 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
|
2022-11-22 10:56:49 +01:00
|
|
|
run: ansible-test sanity -v --color --coverage
|
2022-10-20 12:53:16 +02:00
|
|
|
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
|
|
|
|
2022-11-22 10:58:21 +01:00
|
|
|
# integration:
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# name: Integration (Ⓐ${{ matrix.ansible }}-py${{ matrix.python }})
|
|
|
|
# strategy:
|
|
|
|
# fail-fast: true
|
|
|
|
# max-parallel: 1
|
|
|
|
# matrix:
|
|
|
|
# ansible:
|
|
|
|
# - stable-2.13
|
|
|
|
# python:
|
|
|
|
# - '3.10'
|
2022-10-20 12:53:16 +02:00
|
|
|
|
2022-11-22 10:58:21 +01:00
|
|
|
# steps:
|
|
|
|
# - name: Check out code
|
|
|
|
# uses: actions/checkout@v2
|
|
|
|
# with:
|
|
|
|
# path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
2022-10-20 12:53:16 +02:00
|
|
|
|
2022-11-22 10:58:21 +01: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 }}
|
|
|
|
# EOF
|
2022-10-20 12:53:16 +02:00
|
|
|
|
2022-11-22 10:58:21 +01:00
|
|
|
# - name: Set up Python
|
|
|
|
# uses: actions/setup-python@v2
|
|
|
|
# with:
|
|
|
|
# python-version: ${{ matrix.python }}
|
2022-10-20 12:53:16 +02:00
|
|
|
|
2022-11-22 10:58:21 +01:00
|
|
|
# - name: Install ansible-base (${{ matrix.ansible }})
|
|
|
|
# run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
|
2022-10-20 12:53:16 +02:00
|
|
|
|
2022-11-22 10:58:21 +01:00
|
|
|
# - 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}}
|
2022-10-20 12:53:16 +02:00
|
|
|
|
|
|
|
release:
|
|
|
|
name: Create GitHub Release
|
|
|
|
runs-on: ubuntu-latest
|
2022-11-22 10:58:21 +01:00
|
|
|
needs: [sanity]
|
2022-10-20 12:53:16 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up Python
|
2022-10-20 13:26:59 +02:00
|
|
|
uses: actions/setup-python@v2
|
2022-10-20 12:53:16 +02:00
|
|
|
with:
|
2022-10-20 13:26:59 +02:00
|
|
|
python-version: '3.10'
|
2022-10-20 12:53:16 +02:00
|
|
|
|
|
|
|
- name: Install PyYaml
|
|
|
|
run: pip install pyyaml
|
|
|
|
|
|
|
|
- name: Validate version is published to Galaxy
|
2022-10-20 13:46:11 +02:00
|
|
|
run: curl --head -s -f -o /dev/null https://galaxy.ansible.com/download/grafana-grafana-${{ github.event.inputs.version }}.tar.gz
|
2022-10-20 12:53:16 +02:00
|
|
|
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2022-10-20 13:26:59 +02:00
|
|
|
tag_name: ${{ github.event.inputs.version }}
|