Skip to content

CI

CI #908

Workflow file for this run

name: CI
on:
push:
branches:
- devel
- stable-*
pull_request:
schedule:
- cron: '0 6 * * *'
jobs:
sanity:
name: Sanity (Ⓐ${{ matrix.ansible }})
strategy:
matrix:
ansible:
- stable-2.11
- stable-2.12
- stable-2.13
- stable-2.14
- stable-2.15
- stable-2.16
- stable-2.17
- stable-2.18
- devel
runs-on: ubuntu-latest
steps:
- name: Perform sanity testing
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
testing-type: sanity
integration:
runs-on: ubuntu-latest
name: I (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
services:
redis:
image: redis
ports:
- 6379:6379
duffy:
image: quay.io/evgeni/duffy-mock:latest
ports:
- 8080:8080
strategy:
fail-fast: false
matrix:
ansible:
- stable-2.11
- stable-2.12
- stable-2.13
- stable-2.14
- stable-2.15
- stable-2.16
- stable-2.17
- stable-2.18
- devel
python:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
exclude:
- ansible: stable-2.11
python: '3.12'
- ansible: stable-2.12
python: '3.12'
- ansible: stable-2.13
python: '3.12'
- ansible: stable-2.14
python: '3.12'
- ansible: stable-2.15
python: '3.12'
- ansible: stable-2.11
python: '3.11'
- ansible: stable-2.12
python: '3.11'
- ansible: stable-2.13
python: '3.11'
- ansible: stable-2.11
python: '3.10'
- ansible: stable-2.18
python: '3.10'
- ansible: devel
python: '3.10'
- ansible: stable-2.15
python: '3.8'
- ansible: stable-2.14
python: '3.8'
- ansible: stable-2.16
python: '3.8'
- ansible: stable-2.17
python: '3.8'
- ansible: stable-2.18
python: '3.8'
- ansible: devel
python: '3.8'
- ansible: stable-2.16
python: '3.9'
- ansible: stable-2.17
python: '3.9'
- ansible: stable-2.18
python: '3.9'
- ansible: devel
python: '3.9'
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/evgeni/duffy
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Set up Ansible ${{ matrix.ansible }}
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Install dependencies
run: pip install duffy[client]
- name: Configure duffy client
run: curl --create-dirs --output ~/.config/duffy https://raw.githubusercontent.com/evgeni/duffy-mock-container/devel/duffy-mock.yaml
- name: Test duffy client
run: duffy client list-sessions
# Run the integration tests
# As we need to connect to an existing docker container we can't use `--docker` here as the VMs would be on different
# (non-routing) networks, so we run them locally and ensure any required dependencies are installed via `--requirements`
- name: Run integration test
run: ansible-test integration -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --requirements --coverage
working-directory: ./ansible_collections/evgeni/duffy
# ansible-test support producing code coverage date
- name: Generate coverage report
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
working-directory: ./ansible_collections/evgeni/duffy
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
flags: integration