-
-
Notifications
You must be signed in to change notification settings - Fork 142
81 lines (68 loc) · 2.13 KB
/
ci.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
75
76
77
78
79
80
81
---
name: Ansible-OpenWISP2 CI Build
on: # yamllint disable-line rule:truthy
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
jobs:
build:
name: Build ${{ matrix.distro }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
distro:
- ubuntu2004
- ubuntu2204
- ubuntu2404
- debian11
- debian12
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install python dependencies
run: |
pip install molecule molecule-plugins[docker] yamllint ansible-lint docker
pip install openwisp-utils[qa]
# https://github.com/ansible-community/molecule-plugins/issues/256
python -m pip install 'requests<2.32'
- name: Install Ansible Galaxy dependencies
run: ansible-galaxy collection install "community.general:>=3.6.0"
- name: QA checks
continue-on-error: true
run: |
./run-qa-checks
- name: Tests
run: |
mkdir -p ~/.ansible/roles
ln -s $GITHUB_WORKSPACE ~/.ansible/roles/openwisp.openwisp2
molecule test
env:
ROLE_NAME: openwisp2
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
MOLECULE_DISTRO: ${{ matrix.distro }}
ANSIBLE_ROLES_PATH: /home/runner/.cache/molecule/ansible-openwisp2/default/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
import:
name: Update imports on Ansible Galaxy
runs-on: ubuntu-22.04
container: python:3-slim
needs:
- build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps:
- name: Install ansible
run: pip install ansible
- name: Update imports on Ansible Galaxy
run: |
ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} openwisp ansible-openwisp2