Skip to content

Commit

Permalink
Adopt ansible-content-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Jan 28, 2025
1 parent 56168ca commit 79ef51c
Show file tree
Hide file tree
Showing 12 changed files with 910 additions and 230 deletions.
67 changes: 67 additions & 0 deletions .github/actions/generate-tox-ansible-matrix/action.yaml
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
13 changes: 0 additions & 13 deletions .github/workflows/ansible-lint.yml

This file was deleted.

181 changes: 0 additions & 181 deletions .github/workflows/ansible-test.yml

This file was deleted.

Loading

0 comments on commit 79ef51c

Please sign in to comment.