-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (63 loc) · 2.13 KB
/
ansible-test.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: ansible-test
on:
push:
pull_request:
env:
COLL_NS: flowerysong
COLL_NAME: melange
ANSIBLE_COLLECTIONS_PATH: ${{ github.workspace }}
jobs:
build_collection:
name: build collection
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install 'git+https://github.com/ansible/[email protected]#egg=ansible-core'
- name: Build collection
run: ansible-galaxy collection build -vv
- name: Upload collection
uses: actions/upload-artifact@v4
with:
path: ${{ env.COLL_NS }}-${{ env.COLL_NAME }}-*.tar.gz
name: ${{ env.COLL_NS }}-${{ env.COLL_NAME }}
static_analysis:
needs: build_collection
name: static analysis (${{ matrix.ansible_version }}, py${{ matrix.python_version }})
strategy:
fail-fast: false
matrix:
python_version:
- 3.13
ansible_version:
- stable-2.18
- devel
include:
- ansible_version: stable-2.17
python_version: 3.12
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install 'git+https://github.com/ansible/ansible@${{ matrix.ansible_version }}#egg=ansible-core' pycodestyle pylint pyyaml voluptuous yamllint junit-xml
- name: Download collection
uses: actions/download-artifact@v4
with:
name: ${{ env.COLL_NS }}-${{ env.COLL_NAME }}
- name: Install collection
run: ansible-galaxy collection install ${{ env.COLL_NS }}-${{ env.COLL_NAME }}-*.tar.gz
- name: Run tests
run: ansible-test sanity -v --color --docker
working-directory: ./ansible_collections/${{ env.COLL_NS }}/${{ env.COLL_NAME }}