generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
910 additions
and
230 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
name: generate-tox-ansible-matrix | ||
description: Generate a tox ansible matrix for the given scope. | ||
|
||
inputs: | ||
scope: | ||
description: Scope to generate matrix for. | ||
required: false | ||
default: all | ||
type: choice | ||
options: | ||
- all | ||
- sanity | ||
- unit | ||
- integration | ||
|
||
outputs: | ||
envlist: | ||
description: "The generated tox env list." | ||
value: ${{ steps.generate-matrix.outputs.envlist }}" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
# `required: true` seems to be no-op for actions? | ||
# https://github.com/actions/runner/issues/1070 | ||
- name: Fail early if no scope was provided for matrix generation | ||
if: ${{ inputs.scope == '' }} | ||
uses: actions/github-script@v3 | ||
with: | ||
script: | | ||
core.setFailed('A scope needs to be provided to generate matrix.') | ||
- name: Install the latest version of uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
version: "latest" | ||
|
||
# - name: Set up Python | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: "3.11" | ||
|
||
- name: "Check for tox-ansible.ini file, else add default" | ||
run: >- | ||
[ -e tox-ansible.ini ] || { echo "[ansible]" > tox-ansible.ini && echo | ||
-e "skip =\n\tpy3.7\n\tpy3.8\n\t2.9\n\t2.10\n\t2.11\n\t2.12\n\t2.13" >> | ||
tox-ansible.ini; } | ||
shell: bash | ||
|
||
# - name: "Install tox-ansible from PyPI, includes tox" | ||
# shell: bash | ||
# run: python -m pip install tox-ansible | ||
|
||
- name: Generate matrix | ||
id: generate-matrix | ||
shell: bash | ||
run: > | ||
set -euxo pipefail | ||
echo output=$(uv run tox --ansible --gh-matrix --matrix-scope ${{ inputs.scope }} --conf tox-ansible.ini) | ||
echo $output | ||
echo "::warning title=generated-matrix::${output}" | ||
echo "envlist=$output" >> $GITHUB_OUTPUT |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.