-
-
Notifications
You must be signed in to change notification settings - Fork 72
94 lines (85 loc) · 2.8 KB
/
check-v4.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
name: Check v4 modules
on:
push:
paths:
- .github/workflows/check-v4.yml
- 4/*
pull_request:
paths:
- .github/workflows/check-v4.yml
- 4/*
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
CXX: ${{ matrix.compiler }}
INSPIRCD_DEBUG: 3
steps:
- name: Install dependencies
run: |
sudo apt-get update --assume-yes
sudo apt-get install --assume-yes --no-install-recommends \
clang \
curl \
g++ \
git \
jq \
make \
pkg-config
- name: Retrieve latest release
run: |
echo INSPIRCD_VERSION=$(curl https://api.github.com/repos/inspircd/inspircd/releases | jq --raw-output 'map(select((.draft or .prerelease | not) and (.tag_name | startswith("v4.")))) | first .tag_name') >> $GITHUB_ENV
- name: Checkout InspIRCd
uses: actions/checkout@v4
with:
repository: inspircd/inspircd
ref: ${{ env.INSPIRCD_VERSION }}
path: inspircd
- name: Checkout InspIRCd contrib
uses: actions/checkout@v4
with:
path: contrib
- name: Get changed modules
id: changed-modules
uses: tj-actions/changed-files@v45
with:
files: 4/*.cpp
path: contrib
- name: Work out what modules to build
working-directory: inspircd
run: |
if [ '${{ steps.changed-modules.outputs.any_changed }}' = true ]
then
export FILES=$(cd ${{ github.workspace }}/contrib && readlink -f ${{ steps.changed-modules.outputs.all_changed_files }})
else
export FILES=$(readlink -f ${{ github.workspace }}/contrib/4/*.cpp)
fi
for FILE in ${FILES}
do
export MODULES="${MODULES} ${FILE}"
export PACKAGES="${PACKAGES} $(./tools/directive ${FILE} PackageInfo)"
export TARGETS="${TARGETS} $(basename $FILE .cpp)"
done
echo "INSPIRCD_MODULES=${MODULES%% }" >> $GITHUB_ENV
echo "INSPIRCD_PACKAGES=${PACKAGES%% }" >> $GITHUB_ENV
echo "INSPIRCD_TARGET=${TARGETS%% }" >> $GITHUB_ENV
- name: Install module dependencies
if: env.INSPIRCD_PACKAGES != ''
working-directory: inspircd
run: |
sudo apt-get install --assume-yes --no-install-recommends ${INSPIRCD_PACKAGES}
- name: Build the changed modules
working-directory: inspircd
run: |
cp -v ${INSPIRCD_MODULES} src/modules
./configure --development --disable-auto-extras
make --jobs $(($(getconf _NPROCESSORS_ONLN) + 1))
strategy:
fail-fast: false
matrix:
compiler:
- clang++
- g++