Skip to content

Commit

Permalink
First stab at matrix CI testing
Browse files Browse the repository at this point in the history
  • Loading branch information
davestephens authored Sep 10, 2022
1 parent 0e46133 commit 742f781
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,30 @@ on:
workflow_dispatch:

jobs:
test:
name: Test
runs-on: ubuntu-22.04
generate-matrix:
name: Generate test matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Check out the codebase
uses: actions/checkout@v2
- uses: actions/checkout@v2
- id: set-matrix
shell: bash
run: "tests/github-test-matrix.sh"

- name: Set up Python 3
uses: actions/setup-python@v2
test:
name: Test
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
matrix:
role: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- name: Molecule
uses: gofrolist/molecule-action@v2
with:
python-version: '3.x'

- name: Install Ansible
run: pip3 install ansible

- name: Install roles
run: ansible-galaxy install -r requirements.yml

- name: Run playbook
run: ansible-playbook -i tests/inventories/integration_testing/inventory nas.yml -b
molecule_options: --base-config ../../tests/molecule/base.yml
molecule_command: test
molecule_working_dir: ./roles/${{ matrix.role }}
env:
ANSIBLE_FORCE_COLOR: '1'

0 comments on commit 742f781

Please sign in to comment.