-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (47 loc) · 1.6 KB
/
unit.yml
File metadata and controls
52 lines (47 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
name: Unit tests
# yamllint disable-line rule:truthy
on:
workflow_call:
inputs:
ansible_versions:
required: true
type: string
python_versions:
required: true
type: string
matrix_exclude:
required: true
type: string
jobs:
unit:
strategy:
fail-fast: false
matrix:
ansible-version: ${{ fromJSON(inputs.ansible_versions) }}
python-version: ${{ fromJSON(inputs.python_versions) }}
exclude: ${{ fromJSON(inputs.matrix_exclude) }}
runs-on: ubuntu-latest
name: ${{ matrix.ansible-version }}, py${{ matrix.python-version }}
env:
collection_dir: ansible_collections/redhat/openshift_virtualization
work_dir: /home/runner/.ansible/collections
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: collection-tarball
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install ansible-core ${{ matrix.ansible-version }}
run: |
pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check
- name: Install collection
run: |
ansible-galaxy collection install -p ${{ env.work_dir }} redhat-openshift_virtualization-*.tar.gz
- name: Run unit tests
working-directory: ${{ env.work_dir }}/${{ env.collection_dir }}
run: |
ansible-test units --requirements --python ${{ matrix.python-version }}