-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (63 loc) · 1.74 KB
/
build-and-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
name: build-and-test
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'feature*'
- 'feature_*'
- 'feature/*'
- 'hotfix/*'
- 'hotfix*'
- 'master'
schedule:
- cron: '0 22 * * *'
env:
CUSTOM_DIR: 'darkwizard242.packer'
jobs:
code_quality:
name: SonarCloud Code Quality Check
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
path: '${{ env.CUSTOM_DIR }}'
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: '${{ env.CUSTOM_DIR }}'
args: >
-Dsonar.projectVersion=${{ github.ref }}_${{ github.run_number }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
name: Build & Test
runs-on: ubuntu-22.04
strategy:
max-parallel: 10
matrix:
IMAGE: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, debian-bullseye, debian-buster]
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
path: '${{ env.CUSTOM_DIR }}'
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Update repo cache, install python3-setuptools and required pip modules
run: |
sudo apt-get update
sudo apt-get install python3-setuptools -y
pip3 install -U -r $CUSTOM_DIR/requirements.txt
- name: Execute Molecule test of role for ${{ matrix.IMAGE }}
working-directory: '${{ env.CUSTOM_DIR }}'
run: DISTRO=${{ matrix.IMAGE }} molecule test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'