Ansible test #1820
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Ansible test | |
on: | |
push: | |
paths: | |
- "meta/**" | |
- "plugins/**" | |
- "roles/**" | |
- "tests/**" | |
- "*requirements*" | |
- "*.py" | |
- "*ansible*" | |
# pull_request: | |
schedule: | |
- cron: "0 6 * * *" | |
env: | |
NAMESPACE: scale_computing | |
COLLECTION_NAME: hypercore | |
# ANSIBLE_TEST_PREFER_PODMAN: 1 | |
jobs: | |
sanity: | |
name: sanity test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Perform sanity testing with ansible-test | |
uses: ansible-community/ansible-test-gh-action@release/v1 | |
with: | |
ansible-core-version: stable-2.16 | |
target-python-version: 3.11 | |
testing-type: sanity | |
get_matrix: | |
outputs: | |
version_matrix: ${{ steps.set-matrix.outputs.version_matrix }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- run: python -c "import json, yaml; print('version_matrix=' + json.dumps(yaml.safe_load(open('.github/workflows/files/ansible-test-units-matrix.yml'))))" | |
- id: set-matrix | |
name: set version_matrix output | |
# run: echo "::set-output name=matrix::{\"node\":[10, 12, 14]}" | |
run: python -c "import json, yaml; print('version_matrix=' + json.dumps(yaml.safe_load(open('.github/workflows/files/ansible-test-units-matrix.yml'))))" >> $GITHUB_OUTPUT | |
- run: cat $GITHUB_OUTPUT | |
units: | |
needs: get_matrix | |
name: units ${{ matrix.ansible }}-py${{ matrix.python }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: ${{ fromJSON(needs.get_matrix.outputs.version_matrix) }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Perform units testing with ansible-test | |
uses: ansible-community/ansible-test-gh-action@release/v1 | |
with: | |
ansible-core-version: ${{ matrix.ansible }} | |
target-python-version: ${{ matrix.python }} | |
testing-type: units | |
import-galaxy-test: | |
permissions: | |
contents: read | |
name: Import collection with Galaxy importer | |
uses: ansible-community/github-action-test-galaxy-import/.github/workflows/test-galaxy-import.yml@main |