Vendor Galaxy Roles and Collections
This commit is contained in:
parent
c1e1897cda
commit
2aed20393f
3553 changed files with 387444 additions and 2 deletions
45
ansible_collections/grafana/grafana/.github/workflows/alloy-molecule.yml
vendored
Normal file
45
ansible_collections/grafana/grafana/.github/workflows/alloy-molecule.yml
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
name: Alloy Molecule
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: roles/alloy
|
||||
|
||||
jobs:
|
||||
molecule:
|
||||
name: Molecule
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
distro:
|
||||
- rockylinux9
|
||||
- ubuntu2204
|
||||
- debian12
|
||||
- opensuseleap15
|
||||
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install test dependencies.
|
||||
run: pip3 install ansible molecule molecule-plugins[docker] docker
|
||||
|
||||
- name: Run Molecule tests.
|
||||
run: molecule test
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
MOLECULE_DISTRO: ${{ matrix.distro }}
|
||||
69
ansible_collections/grafana/grafana/.github/workflows/full-integration-test.yml
vendored
Normal file
69
ansible_collections/grafana/grafana/.github/workflows/full-integration-test.yml
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
---
|
||||
name: Full Integration Test
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * 0'
|
||||
workflow_dispatch:
|
||||
env:
|
||||
NAMESPACE: grafana
|
||||
COLLECTION_NAME: grafana
|
||||
|
||||
jobs:
|
||||
|
||||
integration:
|
||||
runs-on: ubuntu-20.04
|
||||
name: ${{ matrix.ansible }}-py${{ matrix.python }}
|
||||
strategy:
|
||||
fail-fast: true
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
ansible:
|
||||
- stable-2.11
|
||||
- stable-2.12
|
||||
- stable-2.13
|
||||
- devel
|
||||
python:
|
||||
- '2.7'
|
||||
- '3.5'
|
||||
- '3.6'
|
||||
- '3.7'
|
||||
- '3.8'
|
||||
- '3.9'
|
||||
- '3.10'
|
||||
exclude:
|
||||
- ansible: stable-2.11
|
||||
python: '3.10'
|
||||
|
||||
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 }}
|
||||
test_stack_name: ${{ secrets.ANSIBLE_TEST_CI_STACK }}
|
||||
EOF
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
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: Test Modules
|
||||
run: ansible-test integration -v alert_contact_point alert_notification_policy cloud_api_key cloud_plugin cloud_stack dashboard datasource folder --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker
|
||||
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
||||
|
||||
- name: Cooling Period
|
||||
run: sleep 3m
|
||||
63
ansible_collections/grafana/grafana/.github/workflows/lint.yaml
vendored
Normal file
63
ansible_collections/grafana/grafana/.github/workflows/lint.yaml
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
---
|
||||
name: Lint
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Perform Linting
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install shellcheck
|
||||
run: |
|
||||
wget -c https://github.com/koalaman/shellcheck/releases/download/v0.9.0/shellcheck-v0.9.0.linux.x86_64.tar.xz -O shellcheck.tar.xz && \
|
||||
tar -xvf shellcheck.tar.xz && \
|
||||
sudo mv ./shellcheck-v0.9.0/shellcheck /usr/bin/shellcheck && \
|
||||
rm -rf shellcheck-v0.9.0
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: npm
|
||||
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install pipenv
|
||||
run: |
|
||||
python -m pip install --upgrade pipenv wheel
|
||||
|
||||
- name: Install dependencies
|
||||
run: make install
|
||||
|
||||
- name: Shell Linting
|
||||
run: make ci-lint-shell
|
||||
if: success() || failure()
|
||||
|
||||
# - name: Markdown Linting
|
||||
# run: make ci-lint-markdown
|
||||
# if: success() || failure()
|
||||
|
||||
# - name: Text Linting
|
||||
# run: make ci-lint-text
|
||||
# if: success() || failure()
|
||||
|
||||
- name: Yaml Linting
|
||||
run: make ci-lint-yaml
|
||||
if: success() || failure()
|
||||
|
||||
- name: Editorconfig Linting
|
||||
run: make ci-lint-editorconfig
|
||||
if: success() || failure()
|
||||
|
||||
- name: Ansible Linting
|
||||
run: make ci-lint-ansible
|
||||
if: success() || failure()
|
||||
44
ansible_collections/grafana/grafana/.github/workflows/loki-molecule.yml
vendored
Normal file
44
ansible_collections/grafana/grafana/.github/workflows/loki-molecule.yml
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
name: Loki Molecule
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: roles/loki
|
||||
|
||||
jobs:
|
||||
molecule:
|
||||
name: Molecule
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
distro:
|
||||
- rockylinux9
|
||||
- ubuntu2204
|
||||
- debian12
|
||||
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install test dependencies.
|
||||
run: pip3 install ansible molecule molecule-plugins[docker] docker
|
||||
|
||||
- name: Run Molecule tests.
|
||||
run: molecule test
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
MOLECULE_DISTRO: ${{ matrix.distro }}
|
||||
51
ansible_collections/grafana/grafana/.github/workflows/mimir-molecule.yml
vendored
Normal file
51
ansible_collections/grafana/grafana/.github/workflows/mimir-molecule.yml
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
name: Mimir Molecule
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: roles/mimir
|
||||
|
||||
jobs:
|
||||
molecule:
|
||||
name: Molecule
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
distro:
|
||||
- rockylinux9
|
||||
- rockylinux8
|
||||
- ubuntu2204
|
||||
- debian12
|
||||
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install test dependencies.
|
||||
run: pip3 install ansible-core==2.16 'molecule-plugins[docker]' pytest-testinfra jmespath selinux passlib
|
||||
|
||||
- name: create docker network
|
||||
run: docker network create molecule
|
||||
|
||||
- name: Start s3 backend
|
||||
run: docker run -d -p 9000:9000 -p 9001:9001 --name minio-mimir --network molecule -e "MINIO_ROOT_USER=testtest" -e "MINIO_ROOT_PASSWORD=testtest" -e "MINIO_DEFAULT_BUCKETS=mimir" bitnamilegacy/minio:latest
|
||||
|
||||
- name: Run Molecule tests.
|
||||
run: molecule --debug test
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
MOLECULE_DISTRO: ${{ matrix.distro }}
|
||||
98
ansible_collections/grafana/grafana/.github/workflows/modules-test.yml
vendored
Normal file
98
ansible_collections/grafana/grafana/.github/workflows/modules-test.yml
vendored
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
---
|
||||
name: Modules Test
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 6 * * *'
|
||||
env:
|
||||
NAMESPACE: grafana
|
||||
COLLECTION_NAME: grafana
|
||||
|
||||
jobs:
|
||||
|
||||
sanity:
|
||||
name: Sanity (Ⓐ${{ matrix.ansible }})
|
||||
strategy:
|
||||
matrix:
|
||||
ansible:
|
||||
- stable-2.12
|
||||
- stable-2.13
|
||||
- stable-2.14
|
||||
- devel
|
||||
runs-on: ubuntu-20.04
|
||||
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
|
||||
run: ansible-test sanity -v --docker --color --coverage
|
||||
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
||||
|
||||
integration:
|
||||
runs-on: ubuntu-20.04
|
||||
name: Integration (Ⓐ${{ matrix.ansible }}-py${{ matrix.python }})
|
||||
strategy:
|
||||
fail-fast: true
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
ansible:
|
||||
- stable-2.13
|
||||
python:
|
||||
- '3.10'
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
|
||||
- name: Install ansible-base (${{ matrix.ansible }})
|
||||
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
|
||||
|
||||
- name: Install Requests
|
||||
run: pip install requests
|
||||
|
||||
- name: Create Test Stack
|
||||
run: ansible-test integration -v create_cloud_stack --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker
|
||||
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
||||
|
||||
- name: Test Modules
|
||||
run: ansible-test integration -v alert_contact_point alert_notification_policy cloud_api_key cloud_plugin dashboard datasource folder --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker
|
||||
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
||||
|
||||
- name: Delete Test Stack
|
||||
if: success() || failure()
|
||||
run: ansible-test integration -v delete_cloud_stack --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker
|
||||
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
||||
44
ansible_collections/grafana/grafana/.github/workflows/opentelemetry-collector-molecule.yml
vendored
Normal file
44
ansible_collections/grafana/grafana/.github/workflows/opentelemetry-collector-molecule.yml
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
name: OpenTelemetry Collector Molecule
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: roles/opentelemetry_collector
|
||||
|
||||
jobs:
|
||||
molecule:
|
||||
name: Molecule
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
scenario:
|
||||
- default
|
||||
- default-check-first
|
||||
- latest
|
||||
- non-contrib
|
||||
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install test dependencies.
|
||||
run: pip3 install ansible molecule molecule-plugins[docker] docker pytest-testinfra
|
||||
|
||||
- name: Run Molecule tests.
|
||||
run: molecule test -s ${{ matrix.scenario }}
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
44
ansible_collections/grafana/grafana/.github/workflows/promtail-molecule.yml
vendored
Normal file
44
ansible_collections/grafana/grafana/.github/workflows/promtail-molecule.yml
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
name: Promtail Molecule
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: roles/promtail
|
||||
|
||||
jobs:
|
||||
molecule:
|
||||
name: Molecule
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
distro:
|
||||
- rockylinux9
|
||||
- ubuntu2204
|
||||
- debian12
|
||||
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install test dependencies.
|
||||
run: pip3 install ansible molecule molecule-plugins[docker] docker
|
||||
|
||||
- name: Run Molecule tests.
|
||||
run: molecule test
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
MOLECULE_DISTRO: ${{ matrix.distro }}
|
||||
159
ansible_collections/grafana/grafana/.github/workflows/release.yml
vendored
Normal file
159
ansible_collections/grafana/grafana/.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
---
|
||||
name: GitHub Release
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
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
|
||||
- stable-2.14
|
||||
- devel
|
||||
runs-on: ubuntu-20.04
|
||||
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
|
||||
run: ansible-test sanity -v --docker --color --coverage
|
||||
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
||||
|
||||
integration:
|
||||
runs-on: ubuntu-20.04
|
||||
name: Integration (Ⓐ${{ matrix.ansible }}-py${{ matrix.python }})
|
||||
strategy:
|
||||
fail-fast: true
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
ansible:
|
||||
- stable-2.13
|
||||
python:
|
||||
- '3.10'
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
|
||||
- name: Install ansible-base (${{ matrix.ansible }})
|
||||
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
|
||||
|
||||
- name: Install Requests
|
||||
run: pip install requests
|
||||
|
||||
- name: Create Test Stack
|
||||
run: ansible-test integration -v create_cloud_stack --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker
|
||||
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
||||
|
||||
- name: Test Modules
|
||||
run: ansible-test integration -v alert_contact_point alert_notification_policy cloud_api_key cloud_plugin dashboard datasource folder --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker
|
||||
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
||||
|
||||
- name: Delete Test Stack
|
||||
if: success() || failure()
|
||||
run: ansible-test integration -v delete_cloud_stack --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker
|
||||
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
||||
|
||||
publish:
|
||||
name: Publish to Galaxy
|
||||
runs-on: ubuntu-latest
|
||||
needs: [sanity, integration]
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install Ansible
|
||||
run: pip install ansible-core
|
||||
|
||||
- name: Install PyYaml
|
||||
run: pip install pyyaml
|
||||
|
||||
- name: Validate version matches
|
||||
run: |
|
||||
VERSION=$(python -c "import yaml; print(yaml.safe_load(open('galaxy.yml'))['version'])")
|
||||
if [ "$VERSION" != "${{ github.event.inputs.version }}" ]; then
|
||||
echo "Error: Input version (${{ github.event.inputs.version }}) doesn't match galaxy.yml version ($VERSION)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Build collection
|
||||
id: build
|
||||
run: |
|
||||
ansible-galaxy collection build
|
||||
echo "archive_path=$(ls *.tar.gz)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Publish collection to Galaxy
|
||||
env:
|
||||
ANSIBLE_GALAXY_API_KEY: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
|
||||
run: ansible-galaxy collection publish --api-key ${{ secrets.ANSIBLE_GALAXY_API_KEY }} ${{ steps.build.outputs.archive_path }}
|
||||
|
||||
release:
|
||||
name: Create GitHub Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [publish]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install PyYaml
|
||||
run: pip install pyyaml
|
||||
|
||||
- name: Validate version is published to Galaxy
|
||||
run: curl --head -s -f -o /dev/null https://galaxy.ansible.com/download/grafana-grafana-${{ github.event.inputs.version }}.tar.gz
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: ${{ github.event.inputs.version }}
|
||||
90
ansible_collections/grafana/grafana/.github/workflows/roles-test.yml
vendored
Normal file
90
ansible_collections/grafana/grafana/.github/workflows/roles-test.yml
vendored
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
---
|
||||
name: Roles Test
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 6 * * *'
|
||||
env:
|
||||
NAMESPACE: grafana
|
||||
COLLECTION_NAME: grafana
|
||||
|
||||
jobs:
|
||||
|
||||
sanity:
|
||||
name: Sanity (Ⓐ${{ matrix.ansible }})
|
||||
strategy:
|
||||
matrix:
|
||||
ansible:
|
||||
- stable-2.12
|
||||
- stable-2.13
|
||||
- stable-2.14
|
||||
- devel
|
||||
runs-on: ubuntu-20.04
|
||||
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
|
||||
run: ansible-test sanity -v --docker --color --coverage
|
||||
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
||||
|
||||
integration:
|
||||
runs-on: ubuntu-20.04
|
||||
name: Integration (Ⓐ${{ matrix.ansible }}-py${{ matrix.python }})
|
||||
strategy:
|
||||
fail-fast: true
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
ansible:
|
||||
- stable-2.13
|
||||
python:
|
||||
- '3.10'
|
||||
|
||||
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 }}
|
||||
grafana_url: ${{ secrets.ANSIBLE_GRAFANA_URL }}
|
||||
test_stack_name: ${{ secrets.ANSIBLE_TEST_CI_STACK }}
|
||||
EOF
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
|
||||
- name: Install ansible-base (${{ matrix.ansible }})
|
||||
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
|
||||
|
||||
- name: Install Requests
|
||||
run: pip install requests
|
||||
|
||||
- name: Test Roles
|
||||
run: ansible-test integration -v molecule-grafana-alternative molecule-grafana-default --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker
|
||||
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue