-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (86 loc) · 2.38 KB
/
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# SPDX-FileCopyrightText: 2024 ThysTips <[email protected]>
# SPDX-FileCopyrightText: 2024 Weytop
# SPDX-FileContributor: ThysTips <[email protected]>
#
# SPDX-License-Identifier: CC0-1.0
# SPDX-License-Identifier: GPL-3.0-or-later
name: CI
on:
push:
branches:
- 'main'
pull_request:
workflow_dispatch:
env:
PYTHON_VERSION: 3.12
defaults:
run:
shell: bash
working-directory: ./ansible_collections/weytop/infrastructure
jobs:
compliance:
runs-on: self-hosted
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v4
- id: compliance
name: REUSE Compliance Check
uses: fsfe/reuse-action@v4
lint:
runs-on: self-hosted
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v4
with:
path: ./ansible_collections/weytop/infrastructure
- id: setup-python
name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pipenv'
- id: pipenv
name: Install pipenv
run: |
python3 -m pip install pipenv --upgrade
pipenv sync --dev --python ${{ env.PYTHON_VERSION }}
# - id: ansible-sanity
# name: Test Ansible Collection Sanity
# env:
# HOME: /root
# run: pipenv run ansible-test sanity
- id: ansible-lint
name: Lint Ansible Collection
env:
HOME: /root
run: pipenv run ansible-lint
build:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: self-hosted
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v4
with:
path: ./ansible_collections/weytop/infrastructure
- id: setup-python
name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pipenv'
- id: pipenv
name: Install pipenv
run: |
python3 -m pip install pipenv --upgrade
pipenv sync --dev --python ${{ env.PYTHON_VERSION }}
- id: dist-clean
name: Clean dist directory
run: rm -rf dist || true
- id: build-collection
name: Build Ansible Collection
env:
HOME: /root
run: pipenv run ansible-galaxy collection build --force