-
Notifications
You must be signed in to change notification settings - Fork 7
210 lines (175 loc) · 7.83 KB
/
aes_ci.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
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
# ----------------------------------------------------------------------------
# Title : AES Stream Drivers GitHub Actions Script
# ----------------------------------------------------------------------------
# This file is part of the AES Stream Drivers package. It is subject to
# the license terms in the LICENSE.txt file found in the top-level directory
# of this distribution and at:
# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
# No part of the AES Stream Drivers package, including this file, may be
# copied, modified, propagated, or distributed except according to the terms
# contained in the LICENSE.txt file.
# ----------------------------------------------------------------------------
# The following environment variables are required for this process:
# secrets.GH_TOKEN
name: Repo Integration
on: [push]
jobs:
# ----------------------------------------------------------------------------
test_and_document:
name: Test And Generate Documentation
runs-on: ubuntu-24.04
steps:
# This step checks out a copy of your repository.
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install python3 python3-pip
python -m pip install --upgrade pip
pip install -r pip_requirements.txt
- name: Check for trailing whitespace and tabs
run: |
# Check for trailing whitespace
if grep -rnI '[[:blank:]]$' --include=\*.{c,cpp,h,sh,py} .; then
echo "Error: Trailing whitespace found in the repository!"
exit 1
fi
# Check for tab characters instead of spaces
if grep -rnI $'\t' --include=\*.{c,cpp,h,sh,py} .; then
echo "Error: Tab characters found in the repository! Please use spaces for indentation."
exit 1
fi
# C/C++ Linter
- name: C/C++ Linter
run: |
find . -name '*.h' -o -name '*.cpp' -o -name '*.c' | xargs cpplint
# ----------------------------------------------------------------------------
build:
name: Compile Kernel Module
strategy:
fail-fast: false # I want to see all build errors
matrix:
container: [ "ubuntu:22.04", "ubuntu:24.04", "rockylinux:9", "debian:experimental", "ghcr.io/jjl772/centos7-vault" ]
runs-on: ubuntu-24.04
container: ${{ matrix.container }}
steps:
# FIXME: using checkout@v1 due to nodejs version issues in centos7
- uses: actions/checkout@v1
with:
fetch-depth: 0
# Setup for all debian/ubuntu-based images
- run: |
apt-get update && apt-get upgrade -y && apt-get install -y build-essential make bash sed kmod dkms git pahole
if: ${{ startsWith(matrix.container, 'ubuntu') || startsWith(matrix.container, 'debian') }}
# Ubuntu 22.04, kernels 5.19, 6.5 and 6.8 (ub24.04 uses kernel 6.8 too)
- run: |
apt-get install -y linux-headers-5.19.0-50-generic linux-headers-6.8.0-49-generic linux-headers-6.5.0-45-generic
if: ${{ matrix.container == 'ubuntu:22.04' }}
# Latest released kernel + GCC
- run: |
apt-get install -y linux-headers-amd64
if: ${{ matrix.container == 'debian:experimental' }}
# RHEL7, kernel 3.10
- run: |
yum update -y && yum install -y kernel-devel kernel-modules kernel-headers gcc gcc-c++ make sed git elfutils-libelf-devel
if: ${{ matrix.container == 'ghcr.io/jjl772/centos7-vault' }}
# RHEL9, frankenstein kernel 5.14
- run: |
dnf update -y && dnf install -y kernel-devel kernel-modules-core kernel-headers gcc gcc-c++ make sed git elfutils-libelf-devel
if: ${{ startsWith(matrix.container, 'rocky') || startsWith(matrix.container, 'centos') }}
- name: Compile Driver
run: make driver
- name: Compile App
run: make app
# ----------------------------------------------------------------------------
gen_release:
needs: [test_and_document]
uses: slaclab/ruckus/.github/workflows/gen_release.yml@main
with:
version: '1.0.0'
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
# ----------------------------------------------------------------------------
generate_dkms:
name: Generate DKMS
needs: [gen_release]
runs-on: ubuntu-24.04
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
mod:
- datadev
steps:
# This step checks out a copy of your repository.
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install debhelper dkms fakeroot rpm
python -m pip install --upgrade pip
pip install -r pip_requirements.txt
- name: Get Image Information
id: get_image_info
env:
MOD: ${{ matrix.mod }}
run: |
echo ::set-output name=tag::`git describe --tags`
if [ $MOD == "datadev" ]
then
echo ::set-output name=module::"datadev"
echo ::set-output name=dir::"data_dev/driver"
fi
- name: Setup Package
env:
DEST_DIR: /usr/src/${{ steps.get_image_info.outputs.module }}-${{ steps.get_image_info.outputs.tag }}
MODULE_DIR: ${{ steps.get_image_info.outputs.dir }}
MODULE: ${{ steps.get_image_info.outputs.module }}
VERSION: ${{ steps.get_image_info.outputs.tag }}
run: |
sudo mkdir $DEST_DIR
sudo mkdir $DEST_DIR/src
sudo cp ${MODULE_DIR}/src/* ${DEST_DIR}/src
sudo cp ${MODULE_DIR}/Makefile $DEST_DIR
sudo cp ${MODULE_DIR}/dkms.conf $DEST_DIR
sudo cp ${MODULE_DIR}/${MODULE}.conf $DEST_DIR
sudo echo "PACKAGE_VERSION=$VERSION" | sudo tee -a ${DEST_DIR}/dkms.conf
sudo echo "echo ${MODULE}" | sudo tee -a ${DEST_DIR}/datadev_load.conf
sudo echo "#!/bin/bash" | sudo tee -a ${DEST_DIR}/install.sh
sudo echo "dkms add -m $MODULE -v $VERSION" | sudo tee -a ${DEST_DIR}/install.sh
sudo echo "dkms build -m $MODULE -v $VERSION -a x86_64" | sudo tee -a ${DEST_DIR}/install.sh
sudo echo "dkms install -m $MODULE -v $VERSION -a x86_64" | sudo tee -a ${DEST_DIR}/install.sh
sudo echo "scp ${MODULE}_load.conf /etc/modules-load.d" | sudo tee -a ${DEST_DIR}/install.sh
sudo echo "modprobe ${MODULE}" | sudo tee -a ${DEST_DIR}/install.sh
sudo chmod a+rx ${DEST_DIR}/install.sh
- name: Build Debian Package
env:
MODULE: ${{ steps.get_image_info.outputs.module }}
VERSION: ${{ steps.get_image_info.outputs.tag }}
run: |
sudo dkms add -m $MODULE -v $VERSION
sudo dkms mkdeb -m $MODULE -v $VERSION --source-only
- name: Build Tarball
env:
MODULE: ${{ steps.get_image_info.outputs.module }}
VERSION: ${{ steps.get_image_info.outputs.tag }}
DEST_DIR: /usr/src/${{ steps.get_image_info.outputs.module }}-${{ steps.get_image_info.outputs.tag }}
run: tar -cvvzpf ${MODULE}-${VERSION}.tgz $DEST_DIR
- name: Upload Assets
env:
VERSION: ${{ steps.get_image_info.outputs.tag }}
GIT_REPO: ${{ github.repository }}
MODULE: ${{ steps.get_image_info.outputs.module }}
GH_REPO_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
python scripts/uploadTag.py --tag=$VERSION --repo=$GIT_REPO --file=/var/lib/dkms/${MODULE}/${VERSION}/deb/${MODULE}-dkms_${VERSION}_all.deb
python scripts/uploadTag.py --tag=$VERSION --repo=$GIT_REPO --file=${MODULE}-${VERSION}.tgz