Skip to content

feat: load ansible callback for display scenario exec time #51

feat: load ansible callback for display scenario exec time

feat: load ansible callback for display scenario exec time #51

Workflow file for this run

---
name: Ansible Molecule
on: # yamllint disable-line rule:truthy
push:
tags_ignore:
- '*'
pull_request:
schedule:
- cron: '0 0 1 */3 *'
jobs:
setup:
name: Setup scenarios matrix
runs-on: ubuntu-22.04
outputs:
scenarios: ${{ steps.matrix.outputs.scenarios }}
steps:
- uses: actions/checkout@v3
- id: matrix
run: |
JSON="["
for s in $(find molecule -mindepth 1 -maxdepth 1 -type d -exec basename "{}" \;); do
JSON="${JSON}\"${s}\","
done
JSON="${JSON%?}"
JSON="$JSON]"
echo "::set-output name=scenarios::$(echo $JSON)"
lint:
name: Lint
needs:
- setup
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
with:
path: "${{ github.repository }}"
- name: Run ansible lint
uses: ansible/ansible-lint-action@main
with:
path: "."
test:
name: Scenario "${{ matrix.scenario }}" on ${{ matrix.config.image }}:${{ matrix.config.tag }}
needs:
- lint
- setup
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
scenario: ${{ fromJson(needs.setup.outputs.scenarios) }}
config:
- image: "amazonlinux"
tag: "latest"
- image: "quay.io/centos/centos"
tag: "centos8"
- image: "debian"
tag: "12"
- image: "debian"
tag: "11"
- image: "debian"
tag: "10"
- image: "ubuntu"
tag: "22.04"
steps:
- name: checkout
uses: actions/checkout@v3
with:
path: "${{ github.repository }}"
- name: molecule
uses: gofrolist/molecule-action@v2
with:
# molecule_options: --debug
molecule_command: test
molecule_args: --scenario-name ${{ matrix.scenario }} -d docker
molecule_working_dir: "${{ github.repository }}"
env:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}