-
Notifications
You must be signed in to change notification settings - Fork 4
77 lines (61 loc) · 1.8 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
name: build-and-test
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'feature*'
- 'feature_*'
- 'feature/*'
- 'hotfix/*'
- 'hotfix*'
- 'master'
schedule:
- cron: '0 2 * * *'
jobs:
code_quality:
name: SonarCloud Code Quality Check
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
path: 'darkwizard242.terraform'
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: 'darkwizard242.terraform'
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-22.04, ubuntu-20.04, ubuntu-18.04, rockylinux-8, centos-7, debian-bullseye, debian-buster]
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
path: 'darkwizard242.terraform'
- name: Set up Python 3.10
uses: actions/setup-python@v3
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 pip wheel ansible molecule molecule-plugins[docker] docker yamllint ansible-lint flake8 pytest-testinfra
- name: Execute Molecule test of role for ${{ matrix.IMAGE }}
working-directory: 'darkwizard242.terraform'
run: DISTRO=${{ matrix.IMAGE }} molecule test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'