-
Notifications
You must be signed in to change notification settings - Fork 16
241 lines (212 loc) · 8.44 KB
/
ci-test-interop.yaml
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: DKMS package interoperability tests
# ========== TRIGGER ==========
on:
workflow_dispatch:
workflow_call:
secrets:
GHUB_TOKEN:
required: true
AZ_SAS_TOK:
required: true
jobs:
install_dkms_package:
name: Install DKMS package
runs-on:
- self-hosted
- builder
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
strategy:
fail-fast: false
matrix:
distro:
- ubuntu:22.04
- ubuntu:20.04
- ubuntu:18.04
- centos:8
- centos:7
- rockylinux:8.5
- rockylinux:9.0
# GPG key issues with almalinux:8.5
- almalinux:8.9
- almalinux:9.0
container:
image: ${{ matrix.distro }}
volumes:
- /mnt/cloud:/mnt/cloud
- /mnt/local:/mnt/local
steps:
# --- INSTALL PRE-REQUISITES ---
- name: Clean up the working directory
run: rm -rf *
- name: APT | Update cache and Git PPA
if: "contains(matrix.distro, 'ubuntu')"
run: |
apt-get update
apt-get install -y software-properties-common
apt-get update
add-apt-repository -y ppa:git-core/ppa
apt-get update
- name: APT | Install pre-requisite packages
if: "contains(matrix.distro, 'ubuntu')"
run: >-
apt-get -o Dpkg::Options::="--force-confdef"
-o Dpkg::Options::="--force-confold" -y install
wget sudo dkms git
env:
DEBIAN_FRONTEND: noninteractive
- name: CentOS 7 / 8 | Fix EOL CentOS 7 and 8 to point to vault
if: matrix.distro == 'centos:8' || matrix.distro == 'centos:7'
run: |
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#.*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
- name: YUM | Add pre-requisite repositories
if: matrix.distro == 'centos:7'
# centos-release-scl required for GCC 8, endpoint-repo required for git
run: |
yum clean all
yum distro-sync -y
yum install -y epel-release
yum install -y centos-release-scl
yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
# Need to do this again after adding the new repositories
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#.*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
- name: YUM | Remove existing git packages
if: matrix.distro == 'centos:7'
run: yum remove -y git git-*
- name: YUM | Add pre-requisites packages
if: matrix.distro == 'centos:7'
run: |
yum install -y epel-release
yum install -y wget sudo dkms git
- name: DNF | Install pre-requisite packages
if: >-
${{ contains(matrix.distro, 'centos:8') ||
contains(matrix.distro, 'rockylinux') ||
contains(matrix.distro, 'almalinux') }}
run: |
dnf clean all
dnf distro-sync -y
dnf install -y epel-release
dnf install -y wget sudo dkms git
# --- CLONE REPOSITORIES ---
- name: Checkout nfp driver kmods repo
uses: Corigine/ci-libs/github_actions/utilities/checkout_corigine@main
with:
fetch-depth: 0
token: ${{ secrets.GHUB_TOKEN }}
- name: Clone ci-libs (for other GH actions)
uses: Corigine/ci-libs/github_actions/utilities/checkout_corigine@main
with:
repository: Corigine/ci-libs
token: ${{ secrets.GHUB_TOKEN }}
path: ci-libs
- name: Install azcopy binary
run: |
wget https://azcopyvnext.azureedge.net/releases/release-10.24.0-20240326/azcopy_linux_amd64_10.24.0.tar.gz \
-O /tmp/downloadazcopy-v10-linux.tgz
tar -xvf /tmp/downloadazcopy-v10-linux.tgz -C /tmp/
sudo cp /tmp/azcopy_linux_amd64_*/azcopy /usr/bin/
# --- COLLECT INFO AND DOWNLOAD PACKAGE ---
- name: Collect package information
id: describe
shell: bash
run: |-2
case "$DISTRO" in
"ubuntu"*)
BINARY_TYPE="deb"
;;
"centos"* | "rockylinux"* | "almalinux"*)
BINARY_TYPE="rpm"
;;
*)
BINARY_TYPE="unknown"
;;
esac
PACKAGE_NAME=$(.github/scripts/describe-head.sh --pkg_name)
PACKAGE_VERSION=$(.github/scripts/describe-head.sh --pkg_ver)
echo "pkg_name=${PACKAGE_NAME}" | tee -a $GITHUB_OUTPUT
echo "pkg_version=${PACKAGE_VERSION}" | tee -a $GITHUB_OUTPUT
echo "binary_type=${BINARY_TYPE}" | tee -a $GITHUB_OUTPUT
# DEFAULT_BRANCH defaults to public-main, but can be used to denote
# other long-running branches for separate interim releases
DEFAULT_BRANCH=$(bash .github/scripts/describe-head.sh --default_branch)
echo "default_branch=${DEFAULT_BRANCH}" | tee -a $GITHUB_OUTPUT
# Determine the target folder for releases and pre-releases
TARGET_FOLDER=${HEAD_REF#*release-}
TARGET_FOLDER=${TARGET_FOLDER:0:5}
# If the default branch is not 'public-main', append the branch name,
# without 'wip-', to the upload destination.
# If the default branch is a customer branch (*-main), append
# customer name to directory.
case ${DEFAULT_BRANCH} in
"public-main")
readonly DST_SUFFIX=""
;;
"wip-"*)
readonly DST_SUFFIX=".${DEFAULT_BRANCH#wip-}"
;;
*"-main")
# Customer branch
readonly DST_SUFFIX=".${DEFAULT_BRANCH%-main}"
;;
*)
readonly DST_SUFFIX=""
;;
esac
case $HEAD_REF in
release-[0-9][0-9].[0-9][0-9].[0-9]|\
${DEFAULT_BRANCH%-main}-release-[0-9][0-9].[0-9][0-9].[0-9])
# Release tag
AZURE_PATH="binaries/nfp-drv-dkms/releases${DST_SUFFIX}/${TARGET_FOLDER}"
;;
prerelease-[0-9][0-9].[0-9][0-9].[0-9]-rc[0-9]|\
${DEFAULT_BRANCH%-main}-prerelease-[0-9][0-9].[0-9][0-9].[0-9]-rc[0-9])
# Prerelease tag
AZURE_PATH="binaries/nfp-drv-dkms/prereleases${DST_SUFFIX}/${TARGET_FOLDER}"
;;
${DEFAULT_BRANCH})
AZURE_PATH="binaries/nfp-drv-dkms/interim${DST_SUFFIX}/${PACKAGE_NAME}"
;;
*)
AZURE_PATH="tmp/nfp_drv_dkms_builds${DST_SUFFIX}"
AZURE_PATH="${AZURE_PATH}/${{ github.actor }}"
;;
esac
echo "azure_dest=$(echo "${AZURE_PATH}")" | tee -a $GITHUB_OUTPUT
env:
DISTRO: ${{ matrix.distro }}
HEAD_REF: ${{ github.head_ref || github.ref_name }}
- name: Find package name from Azure
uses: ./ci-libs/github_actions/azure/azcopy_list
id: artifact
with:
connection-string: ${{ secrets.AZ_SAS_TOK }}
src: ${{ steps.describe.outputs.azure_dest }}
pattern: "${{ steps.describe.outputs.pkg_version }}.*${{ steps.describe.outputs.binary_type }}"
- name: Download DKMS Package from Azure storage
uses: ./ci-libs/github_actions/azure/azcopy_download_sync
with:
connection-string: ${{ secrets.AZ_SAS_TOK }}
src: "${{ steps.describe.outputs.azure_dest }}/${{ steps.artifact.outputs.latest }}"
dst: "./${{ steps.describe.outputs.pkg_name }}.${{ steps.describe.outputs.binary_type }}"
# --- INSTALL DKMS PACKAGE ---
- name: APT | Install DKMS package
if: "contains(matrix.distro, 'ubuntu')"
run: dpkg -i ${DKMS_PACKAGE}
env:
DKMS_PACKAGE: "${{ steps.describe.outputs.pkg_name }}.deb"
- name: YUM | Install DKMS package
if: matrix.distro == 'centos:7'
run: yum -y install ${DKMS_PACKAGE}
env:
DKMS_PACKAGE: "${{ steps.describe.outputs.pkg_name }}.rpm"
- name: DNF | Install DKMS package
if: >-
${{ contains(matrix.distro, 'centos:8') ||
contains(matrix.distro, 'rockylinux') ||
contains(matrix.distro, 'almalinux') }}
run: dnf -y install ${DKMS_PACKAGE}
env:
DKMS_PACKAGE: "${{ steps.describe.outputs.pkg_name }}.rpm"