-
Notifications
You must be signed in to change notification settings - Fork 148
83 lines (81 loc) · 3.48 KB
/
unit-tests.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
name: Unit Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: Run unit tests in containers
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scenarios:
# 9to10
- name: Run unit tests for el9toel10 and common repositories on python 3.12
python: python3.12
repos: 'el9toel10,common'
container: ubi9
- name: Run python linters for el9toel10 and common repositories on python 3.12
python: python3.12
repos: 'el9toel10,common'
container: ubi9-lint
- name: Run unit tests for el9toel10 and common repositories on python 3.9
python: python3.9
repos: 'el9toel10,common'
container: ubi9
- name: Run python linters for el9toel10 and common repositories on python 3.9
python: python3.9
repos: 'el9toel10,common'
container: ubi9-lint
# 8to9
- name: Run unit tests for el8toel9 and common repositories on python 3.9
python: python3.9
repos: 'el8toel9,common'
container: ubi9
- name: Run python linters for el8toel9 and common repositories on python 3.9
python: python3.9
repos: 'el8toel9,common'
container: ubi9-lint
- name: Run unit tests for el8toel9 and common repositories on python 3.6
python: python3.6
repos: 'el8toel9,common'
container: ubi8
- name: Run python linters for el8toel9 and common repositories on python 3.6
python: python3.6
repos: 'el8toel9,common'
container: ubi8-lint
# 7to8
- name: Run unit tests for el7toel8 and common repositories on python 3.6
python: python3.6
repos: 'el7toel8,common'
container: ubi8
- name: Run python linters for el7toel8 and common repositories on python 3.6
python: python3.6
repos: 'el7toel8,common'
container: ubi8-lint
- name: Run unit tests for el7toel8 and common repositories on python 2.7
python: python2.7
repos: 'el7toel8,common'
container: ubi7
- name: Run python linters for el7toel8 and common repositories on python 2.7
python: python2.7
repos: 'el7toel8,common'
container: ubi7-lint
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# NOTE(ivasilev) fetch-depth 0 is critical here as leapp deps discovery depends on specific substring in
# commit message and default 1 option will get us just merge commit which has an unrelevant message.
fetch-depth: '0'
# NOTE(ivasilev) main -> origin/main is used for leapp deps discovery in Makefile via git log main..HEAD
- name: Set main to origin/main
if: github.ref != 'refs/heads/main'
run: |
git branch -f main origin/main
- name: ${{matrix.scenarios.name}}
run: script -e -c /bin/bash -c 'TERM=xterm podman build --security-opt=seccomp=unconfined -t leapp-tests -f utils/container-tests/Containerfile.${{matrix.scenarios.container}} utils/container-tests && PYTHON_VENV=${{matrix.scenarios.python}} REPOSITORIES=${{matrix.scenarios.repos}} podman run --security-opt=seccomp=unconfined --rm -ti -v ${PWD}:/payload --env=PYTHON_VENV --env=REPOSITORIES leapp-tests'