-
Notifications
You must be signed in to change notification settings - Fork 38
90 lines (76 loc) · 2.19 KB
/
integration-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
84
85
86
87
88
89
name: Integration tests
on:
push:
branches: [main, hirte-*]
pull_request:
branches: [main, hirte-*]
workflow_dispatch:
jobs:
rpmbuild:
runs-on: ubuntu-latest
container:
image: quay.io/hirte/build-base:latest
env:
ARTIFACTS_DIR: exported-artifacts
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
# Use githash of a tested commit instead of merge commit
ref: ${{ github.event.pull_request.head.sha }}
- name: Perform build
run: |
./build-scripts/build-rpm.sh $ARTIFACTS_DIR
- name: Create DNF repository
run: |
createrepo_c $ARTIFACTS_DIR
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: rpm-artifacts
path: ${{ env.ARTIFACTS_DIR}}
test:
needs: rpmbuild
runs-on: ubuntu-latest
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install \
genisoimage \
libkrb5-dev \
libvirt-daemon-system \
libvirt-dev \
pkg-config \
podman \
qemu-kvm \
-y
- name: Install unpackaged python libraries from PyPi
run: |
pip install "tmt[provision]" "tmt[report-junit]" podman pytest pytest-timeout
- name: Checkout sources
uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: rpm-artifacts
path: 'tests/hirte-rpms'
- name: Run integration tests
run: |
cd tests
tmt run -eCONTAINER_USED=integration-test-local
- name: Show tmt log output in case of failure
if: ${{ failure() }}
run: |
cat /var/tmp/tmt/run-001/log.txt
- name: Gather tests artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: test-artifacts
path: '/var/tmp/tmt'