-
Notifications
You must be signed in to change notification settings - Fork 20
108 lines (90 loc) · 3.14 KB
/
check.yaml
File metadata and controls
108 lines (90 loc) · 3.14 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
100
101
102
103
104
105
106
107
108
#
# CI for this project needs to do two things:
# 1. Setup the environment and run `yarn build`
# 2. Build the distribution rpm for use in QE/OST/Integration testing
#
name: run CI on PRs
on:
pull_request:
jobs:
build_offline:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: centos-stream-9
shortcut: cs9
container-name: el9stream
- name: centos-stream-10
shortcut: cs10
container-name: el10stream
name: ${{ matrix.name }} - test, build and publish rpm repo for the PR (ovirt-engine-nodejs-modules build)
container:
image: quay.io/ovirt/buildcontainer:${{ matrix.container-name }}
env:
OFFLINE_BUILD: 1
steps:
- name: Mark git repo as safe
run: git config --global --add safe.directory $(pwd)
- name: Install EPEL (for rpmlint on el10) and rpmlint
run: |
dnf -y install epel-release
dnf -y install rpmlint
- name: Ensure latest ovirt-engine-nodejs-modules is installed
run: |
rpm -q --quiet ovirt-engine-nodejs-modules && ACTION=upgrade || ACTION=install
dnf -y $ACTION ovirt-engine-nodejs-modules
- name: Checkout sources
uses: ovirt/checkout-action@main
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run packaging/build.sh
run: |
./packaging/build.sh
- name: Upload artifacts as rpm repo
uses: ovirt/upload-rpms-action@main
with:
directory: exported-artifacts/
build_online:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: centos-stream-9
shortcut: cs9
container-name: el9stream
- name: centos-stream-10
shortcut: cs10
container-name: el10stream
name: ${{ matrix.name }} - build the project the PR, but skip the rpm builds (online build)
container:
image: quay.io/ovirt/buildcontainer:${{ matrix.container-name }}
env:
OFFLINE_BUILD: 0
MOVE_ARTIFACTS: 0
steps:
- name: Install yarn (online mode does not use ovirt-engine-nodejs-modules so yarn isn't installed)
run: |
dnf -y config-manager --add-repo https://dl.yarnpkg.com/rpm/yarn.repo
dnf -y --disablerepo='*' --enablerepo='yarn*' install yarn
- name: Checkout sources
uses: ovirt/checkout-action@main
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn's work to use in the build job
uses: actions/cache@v3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
./node_modules
key: ${{ github.sha }}
- name: Run 'yarn install' and 'yarn build'
run: |
yarn install
yarn build
# Note: The source tar, srpm and rpm are not needed for the online build. We only
# need 1 rpm repo artifact per distro. The rpm repo is generated from the
# offline build.