chore(deps): update actions/upload-artifact digest to 6f51ac0 #796
Workflow file for this run
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: CI (Lint + Molecule) | |
"on": | |
workflow_dispatch: | |
inputs: | |
lint: | |
description: "Lint" | |
required: true | |
default: true | |
type: boolean | |
distro: | |
description: "Select a Distribution to run" | |
required: false | |
type: choice | |
default: "ubuntu2204" | |
options: | |
- ubuntu2004 | |
- ubuntu2204 | |
- debian11 | |
- debian12 | |
- rockylinux8 | |
- rockylinux9 | |
- fedora39 | |
- ALL | |
ansible_version: | |
description: "Select Ansible Versions to run" | |
required: false | |
type: choice | |
# (minimum) | |
default: "ansible-6" | |
options: | |
- ansible-6,ansible-7,ansible-8,ansible-9 | |
- ansible-7,ansible-8,ansible-9 | |
- ansible-8,ansible-9 | |
- ansible-6 | |
- ansible-7 | |
- ansible-8 | |
- ansible-9 | |
pull_request: | |
branches-ignore: | |
- renovate/** | |
paths: | |
- ".github/workflows/ci.yml" | |
- "defaults/**" | |
- "handlers/**" | |
- "meta/**" | |
- "molecule/**" | |
- "tasks/**" | |
- "vars/**" | |
- ".ansible-lint" | |
- ".gitattributes" | |
- ".yamllint" | |
- "pyproject.toml" | |
- "requirements-dev.txt" | |
- "requirements.yml" | |
- "tox.ini" | |
push: | |
branches: | |
- master | |
- renovate/** | |
paths: | |
- ".github/workflows/ci.yml" | |
- "defaults/*" | |
- "handlers/*" | |
- "meta/**" | |
- "molecule/**" | |
- "tasks/*" | |
- "vars/*" | |
- ".ansible-lint" | |
- ".gitattributes" | |
- ".yamllint" | |
- "pyproject.toml" | |
- "requirements.yml" | |
- "tox.ini" | |
schedule: | |
# At 05:00 on Sunday. | |
- cron: "0 5 * * 0" | |
permissions: read-all | |
jobs: | |
lint: | |
name: Lint | |
if: ${{ github.event.inputs.lint != 'false' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: check out the codebase | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: set up python 3 | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
with: | |
python-version: "3.10" | |
- name: Install yamllint package. | |
run: pip3 install "yamllint==1.*" | |
- name: Lint YAML (GitHub Annotations) | |
run: | | |
cat <<HEREDOC | |
Wondering about why there are no file names? | |
This command outputs information parsed by GitHub | |
to be displayed in 'Annotations' tab. | |
HEREDOC | |
yamllint . -f github | |
- name: Lint YAML (Standard Output) | |
if: always() | |
run: yamllint . -f standard | |
molecule: | |
name: Molecule | |
runs-on: ubuntu-latest | |
strategy: | |
# half length of matrix's distro list / most important: | |
max-parallel: 4 | |
matrix: | |
distro: | |
# ensure diversity in first half: | |
- ubuntu2204 | |
- debian12 | |
- rockylinux9 | |
- fedora39 | |
# other: | |
- rockylinux8 | |
- ubuntu2004 | |
- debian11 | |
env: | |
WORKFLOW_DISPATCH_IF: >- | |
${{github.event_name == 'workflow_dispatch' && | |
(github.event.inputs.distro == 'ALL' || | |
contains(matrix.distro, github.event.inputs.distro)) }} | |
steps: | |
- name: if this step is run, this is a real ci run | |
run: > | |
cat << EOF | |
If this step is NOT skipped, this workflow run was manually dispatched | |
and the chosen distro does not match the current matrix distro. | |
This is a hack because GitHub CI does not allow for a state other than "failed" | |
as per https://github.com/actions/runner/issues/662 | |
EOF | |
if: github.event_name != 'workflow_dispatch' || env.WORKFLOW_DISPATCH_IF == 'true' | |
- name: check out the codebase | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: set up python 3 | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
with: | |
python-version: "3.10" | |
- name: setup/activate pre-commit cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4 | |
with: | |
path: ~/.cache/pre-commit | |
key: ${{ hashFiles('**/.pre-commit-config.yaml') }} | |
- name: Install test dependencies. | |
run: pip3 install -r requirements-dev.txt | |
- name: Run Molecule tests (normal). | |
run: tox | |
env: | |
TOX_SKIP_ENV: pre-commit | |
MOLECULE_DISTRO: ${{ matrix.distro }} | |
if: github.event_name != 'workflow_dispatch' | |
- name: Run Molecule tests (debug). | |
run: tox | |
env: | |
TOXENV: py3-${{ github.event.inputs.ansible_version }} | |
TOX_SKIP_ENV: pre-commit | |
MOLECULE_DESTROY: never | |
MOLECULE_DISTRO: ${{ matrix.distro }} | |
if: env.WORKFLOW_DISPATCH_IF == 'true' | |
- name: Upload output of /molecule/resources/debug.yml as CI Artifact | |
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4 | |
with: | |
name: debug-${{ matrix.distro }}.yml | |
path: | | |
/var/tmp/vars.yml | |
/var/tmp/environment.yml | |
- name: setup tmate session if previous step failed and if this is a manual run | |
if: failure() && env.WORKFLOW_DISPATCH_IF == 'true' | |
uses: mxschmitt/action-tmate@e5c7151931ca95bad1c6f4190c730ecf8c7dde48 # v3 | |
timeout-minutes: 30 |