-
Notifications
You must be signed in to change notification settings - Fork 1.1k
137 lines (123 loc) · 4.02 KB
/
ci-freebsd.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
name: CI FreeBSD
on:
push:
branches-ignore:
- coverity_scan
- run-fuzzer**
- debug-fuzzer-**
pull_request:
env:
HOSTAPD_BUILD_DIR: eapol_test.ci
HOSTAPD_GIT_TAG: hostap_2_11
NO_PERFORMANCE_TESTS: yes
jobs:
freebsd-build:
runs-on: ubuntu-latest
name: "FreeBSD build"
steps:
# Checkout, but defer pulling LFS objects until we've restored the cache
- uses: actions/checkout@v4
with:
lfs: false
path: freeradius
- name: Create LFS file list as cache key
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
working-directory: freeradius
- name: Restore LFS cache
uses: actions/cache@v4
id: lfs-cache
with:
path: .git/lfs
key: freebsd-lfs-${{ hashFiles('freeradius/.lfs-assets-id') }}-v1
# Now the LFS pull will be local if we hit the cache, or remote otherwise
- name: Git LFS pull
run: git lfs pull
working-directory: freeradius
- name: Restore eapol_test build directory from cache
uses: actions/cache@v4
id: hostapd-cache
with:
path: ${{ env.HOSTAPD_BUILD_DIR }}
key: hostapd-freebsd-${{ env.HOSTAPD_GIT_TAG }}-v4
- name: Test using a FreeBSD VirtualBox VM
uses: cross-platform-actions/[email protected]
with:
operating_system: freebsd
version: '14.0'
sync_files: runner-to-vm
memory: 4G
environment_variables: HOSTAPD_BUILD_DIR HOSTAPD_GIT_TAG NO_PERFORMANCE_TESTS
run: |
sudo pkg install -y \
brotli \
curl \
cyrus-sasl \
freetds \
git \
git-lfs \
gmake \
google-perftools \
hiredis \
json-c \
libidn \
libmemcached \
libpcap \
libyubikey \
lua52 \
luajit-devel \
mariadb-connector-c \
net-snmp \
openldap25-client \
python3 \
py311-pip \
postgresql12-client \
sqlite3 \
talloc \
unixODBC
PIP_BREAK_SYSTEM_PACKAGES=1 pip install tacacs_plus
echo "#! /bin/sh" | sudo tee /usr/local/bin/nproc
echo "sysctl -n hw.ncpu" | sudo tee -a /usr/local/bin/nproc
sudo chmod +x /usr/local/bin/nproc
freebsd-version
cd freeradius
./configure
gmake -j `nproc`
gmake -j `nproc` test.keywords test.unit test.modules test.auth test.digest
gmake test
#
# If the CI has failed and the branch is ci-debug then we start a tmate
# session to provide interactive shell access to the session.
#
# The SSH rendezvous point will be emited continuously in the job output,
# which will look something like:
#
# SSH: ssh [email protected]
#
# For example:
#
# git push origin ci-debug --force
#
# Look at the job output in: https://github.com/FreeRADIUS/freeradius-server/actions
#
# ssh [email protected]
#
# Access requires that you have the private key corresponding to the
# public key of the GitHub user that initiated the job.
#
# The above will open a shell for the MacOS environment on which the
# FreeBSD VM is running within VirtualBox.
#
# Access the FreeBSD VM with:
#
# ssh -t freebsd
#
# The working directory is:
#
# /User/runner/work
#
- name: "Debug: Start tmate"
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }}