-
Notifications
You must be signed in to change notification settings - Fork 1.1k
137 lines (123 loc) · 4.05 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_10
jobs:
freebsd-build:
runs-on: macos-12
name: "FreeBSD build"
steps:
# Checkout, but defer pulling LFS objects until we've restored the cache
- uses: actions/checkout@v3
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@v3
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@v3
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: vmactions/freebsd-vm@v0
with:
usesh: true
sync: rsync
copyback: false
mem: 4096
envs: 'HOSTAPD_BUILD_DIR HOSTAPD_GIT_TAG'
prepare: |
pkg install -y \
curl \
cyrus-sasl \
freetds \
git \
git-lfs \
gmake \
google-perftools \
hiredis \
json-c \
libidn \
libmemcached \
libpcap \
lua52 \
luajit \
mysql80-client \
net-snmp \
openldap25-client \
python3 \
py39-pip \
postgresql12-client \
talloc \
unixODBC
pip install tacacs_plus
echo "#! /bin/sh" > /usr/local/bin/nproc
echo "sysctl -n hw.ncpu" >> /usr/local/bin/nproc
chmod +x /usr/local/bin/nproc
run: |
freebsd-version
cd freeradius
./configure
gmake -j `nproc`
gmake -j `nproc` test.keywords test.unit test.modules test.auth test.digest
gmake test
# Minimise rsync pushback as it often fails with "ssh_dispatch_run_fatal: Connection to A.B.C.D: message authentication code incorrect"
git config --global --add safe.directory $(pwd)
git clean -fxd --exclude="$HOSTAPD_BUILD_DIR"
#
# 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() }}