-
-
Notifications
You must be signed in to change notification settings - Fork 148
59 lines (50 loc) · 1.78 KB
/
unittests.yml
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
53
54
55
56
57
58
59
name: Unittests
on:
push:
pull_request:
schedule:
- cron: 3 0 * * * # Run daily at 0:03 UTC
jobs:
build-collection-artifact:
name: Test
runs-on: ${{ matrix.runner-os }}
strategy:
matrix:
runner-os:
- ubuntu-22.04
# ansible-version:
# - git+https://github.com/ansible/[email protected]
runner-python-version:
- '3.11'
steps:
- name: Check out ${{ github.repository }} on disk
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.runner-python-version }}
- name: Set up pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tests/sanity/requirements.txt') }}-${{ hashFiles('tests/unit/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install requirements for tests
run: >-
python -m pip install --user -r test-requirements.txt
- name: Build a collection tarball
run: >-
~/.local/bin/ansible-galaxy collection build --output-path
"${GITHUB_WORKSPACE}/.cache/collection-tarballs"
- name: Install the collection tarball
run: >-
~/.local/bin/ansible-galaxy collection install ${GITHUB_WORKSPACE}/.cache/collection-tarballs/*.tar.gz
- name: Run collection unit tests
run: >-
~/.local/bin/ansible-test units
--python "${{ matrix.runner-python-version }}" -vvv
tests/unit/plugins/modules/
working-directory: >-
/home/runner/.ansible/collections/ansible_collections/containers/podman