-
Notifications
You must be signed in to change notification settings - Fork 387
99 lines (87 loc) · 3.25 KB
/
validate.yml
File metadata and controls
99 lines (87 loc) · 3.25 KB
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
name: validate
on: [push, pull_request_target]
jobs:
unit-tests:
runs-on: ubuntu-20.04
strategy:
matrix:
# empty = release that corresponds to current branch name
release: ['', 'eln']
include:
- release: eln
build-args: '--build-arg=image=quay.io/fedoraci/fedora:eln-x86_64'
env:
CI_TAG: '${{ matrix.release }}'
CONTAINER_BUILD_ARGS: '${{ matrix.build-args }}'
timeout-minutes: 30
steps:
- name: Clone repository
uses: actions/checkout@v2
with:
# otherwise we are testing target branch instead of the PR branch (see pull_request_target trigger)
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Rebase to current master
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git log --oneline -1 origin/master
git rebase origin/master
- name: Check if container changed in this PR
id: check-dockerfile-changed
run: |
changes=$(git diff origin/master..HEAD -- dockerfile/anaconda-ci/)
# print for debugging
echo "$changes"
[ -z "$changes" ] || echo "::set-output name=changed::true"
# build container if files for dockerfile changed in the PR
- name: Build anaconda-ci container
# FIXME: always build ELN container, until we publish it to quay.io
if: steps.check-dockerfile-changed.outputs.changed || matrix.release == 'eln'
run: make -f Makefile.am anaconda-ci-build
- name: Run tests in anaconda-ci container
run: |
# put the log in the output, where it's easy to read and link to
make -f Makefile.am container-ci || { cat test-logs/test-suite.log; exit 1; }
- name: Upload test and coverage logs
if: always()
uses: actions/upload-artifact@v2
with:
name: 'logs${{ matrix.release }}'
path: test-logs/*
rpm-tests:
runs-on: ubuntu-20.04
strategy:
matrix:
# empty = release that corresponds to current branch name
release: ['', 'eln']
include:
- release: eln
build-args: '--build-arg=image=quay.io/fedoraci/fedora:eln-x86_64'
env:
CI_TAG: '${{ matrix.release }}'
CONTAINER_BUILD_ARGS: '${{ matrix.build-args }}'
timeout-minutes: 30
steps:
- name: Clone repository
uses: actions/checkout@v2
with:
# otherwise we are testing target branch instead of the PR branch (see pull_request_target trigger)
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Rebase to current master
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git log --oneline -1 origin/master
git rebase origin/master
- name: Build RPM test container
run: make -f Makefile.am anaconda-rpm-build
- name: Run RPM tests in container
run: make -f Makefile.am container-rpm-test
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v2
with:
name: 'logs-rpm-test'
path: test-logs/*