-
-
Notifications
You must be signed in to change notification settings - Fork 115
150 lines (147 loc) · 9.52 KB
/
build.yml
File metadata and controls
150 lines (147 loc) · 9.52 KB
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
name: Build
on:
push:
branches:
- '**'
tags-ignore:
- '**'
pull_request:
workflow_dispatch:
env:
LJT_VERSION: 3.1.4.1
LJT_GPG_KEY: https://raw.githubusercontent.com/libjpeg-turbo/repo/main/LJT-GPG-KEY
jobs:
linux:
runs-on: ubuntu-latest
steps:
- name: Set global environment variables
run: |
echo "BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >$GITHUB_ENV
echo "LJT_URL=https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/$LJT_VERSION" >>$GITHUB_ENV
- name: Check out code
uses: actions/checkout@v4
- name: Set up build
run: |
mkdir -p $HOME/src/vgl.nightly
docker pull dcommander/buildvgl:$BRANCH
git clone --depth=1 https://github.com/VirtualGL/buildscripts.git -b $BRANCH $HOME/src/buildscripts
mkdir $HOME/libjpeg-turbo-rpm
pushd $HOME/libjpeg-turbo-rpm
wget --no-check-certificate $LJT_URL/libjpeg-turbo-official-$LJT_VERSION.x86_64.rpm $LJT_URL/libjpeg-turbo-official-$LJT_VERSION.aarch64.rpm $LJT_URL/libjpeg-turbo-official-$LJT_VERSION.i386.rpm
popd
mkdir $HOME/rpmkeys
wget --no-check-certificate "$LJT_GPG_KEY" -O $HOME/rpmkeys/LJT-GPG-KEY
wget --no-check-certificate http://www.virtualgl.org/key/VGLPR-GPG-KEY -O $HOME/rpmkeys/VGLPR-GPG-KEY
- name: Configure GPG signing
if: ${{github.event_name != 'pull_request'}}
run: |
sudo apt install -y gnupg1
printf "${{secrets.GPG_KEY}}" | base64 --decode | gpg1 --batch --import -
chmod 600 $HOME/.gnupg/gpg.conf
echo "GPG_KEY_NAME=\"${{secrets.GPG_KEY_NAME}}\"" >$HOME/src/buildscripts/gpgsign
echo "GPG_KEY_ID=${{secrets.GPG_KEY_ID}}" >>$HOME/src/buildscripts/gpgsign
echo "GPG_KEY_PASS=${{secrets.GPG_KEY_PASS}}" >>$HOME/src/buildscripts/gpgsign
- name: Build
run: |
docker run -v $HOME/src/vgl.nightly:/root/src/vgl.nightly -v $HOME/src/buildscripts:/root/src/buildscripts -v $GITHUB_WORKSPACE:/root/src/virtualgl -v $HOME/.gnupg:/root/.gnupg -v $HOME/libjpeg-turbo-rpm:/rpms -v $HOME/rpmkeys:/rpmkeys -t dcommander/buildvgl:$BRANCH bash -c "rpm --import /rpmkeys/LJT-GPG-KEY && rpm -K /rpms/*.rpm && rpm -i /rpms/*86*.rpm && pushd /opt/arm64 && rpm2cpio /rpms/*aarch64*.rpm | cpio -id && popd && rpm --import /rpmkeys/VGLPR-GPG-KEY && ~/src/buildscripts/buildvgl -d /root/src/virtualgl -v"
sudo chown -R runner:runner $HOME/src/vgl.nightly
mv $HOME/src/vgl.nightly/latest/log-${{github.job}}.txt $HOME/src/vgl.nightly/latest/files/
- name: Configure AWS
if: ${{github.event_name != 'pull_request'}}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
aws-region: ${{secrets.AWS_REGION}}
- name: Deploy
if: ${{github.event_name != 'pull_request'}}
run: |
aws s3 sync --acl public-read --delete $HOME/src/vgl.nightly/latest/files/ s3://virtualgl-pr/${{env.BRANCH}}/${{github.job}}/
linux-non-default-options:
runs-on: ubuntu-latest
steps:
- name: Set global environment variables
run: |
echo "BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >$GITHUB_ENV
echo "LJT_URL=https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/$LJT_VERSION" >>$GITHUB_ENV
- name: Check out code
uses: actions/checkout@v4
- name: Set up build
run: |
sudo apt update
sudo apt install -y libegl1-mesa-dev libfltk1.3-dev ocl-icd-opencl-dev libx11-xcb-dev libxcb-glx0-dev libxcb-keysyms1-dev libxtst-dev
mkdir $HOME/libjpeg-turbo-deb
pushd $HOME/libjpeg-turbo-deb
wget --no-check-certificate $LJT_URL/libjpeg-turbo-official_$LJT_VERSION\_amd64.deb $LJT_URL/libjpeg-turbo-official32_$LJT_VERSION\_amd64.deb
sudo dpkg -i *.deb
rm *.deb
popd
rmdir $HOME/libjpeg-turbo-deb
- name: Build
run: |
mkdir build
pushd build
cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_FLAGS='-ansi -Wall -Werror -Wextra -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wmissing-include-dirs -Wshift-overflow=2 -Wunused -Wno-unused-parameter -Wuse-after-free=3 -Wuninitialized -Wstrict-overflow=2 -Wstringop-overflow=4 -Wstringop-truncation -Warray-bounds=2 -Wattribute-alias=2 -Wbidi-chars=any -Wduplicated-branches -Wduplicated-cond -Wtrampolines -Wfloat-equal -Wdeclaration-after-statement -Wshadow -Wunsafe-loop-optimizations -Wpointer-arith -Wundef -Wcast-align -Wjump-misses-init -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wvariadic-macros -Wdisabled-optimization' \
-DCMAKE_CXX_FLAGS='-ansi -Wall -Werror -Wextra -Wpedantic -pedantic-errors -Wno-missing-field-initializers -Wdouble-promotion -Wformat=2 -Wno-format-nonliteral -Wformat-overflow=2 -Wmissing-include-dirs -Wshift-overflow=2 -Wunused -Wno-unused-parameter -Wunused-const-variable=1 -Wuse-after-free=3 -Wuseless-cast -Wuninitialized -Wstrict-overflow=2 -Wstringop-overflow=4 -Wstringop-truncation -Warray-bounds=2 -Wattribute-alias=2 -Wbidi-chars=any -Wduplicated-branches -Wduplicated-cond -Wtrampolines -Wshadow -Wunsafe-loop-optimizations -Wpointer-arith -Wundef -Wcast-align -Wcatch-value=3 -Wextra-semi -Wlogical-op -Wpacked -Wredundant-decls -Winline -Wvariadic-macros -Wdisabled-optimization' \
..
export NUMCPUS=`grep -c '^processor' /proc/cpuinfo`
make -j$NUMCPUS --load-average=$NUMCPUS
popd
rm -rf build
mkdir build
pushd build
cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DVGL_FAKEOPENCL=0 -DVGL_FAKEXCB=0 -DVGL_SYSTEMFLTK=1 -DVGL_USEXV=0 \
-DCMAKE_C_FLAGS='-ansi -Wall -Werror -Wextra -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wmissing-include-dirs -Wshift-overflow=2 -Wunused -Wno-unused-parameter -Wuse-after-free=3 -Wuninitialized -Wstrict-overflow=2 -Wstringop-overflow=4 -Wstringop-truncation -Warray-bounds=2 -Wattribute-alias=2 -Wbidi-chars=any -Wduplicated-branches -Wduplicated-cond -Wtrampolines -Wfloat-equal -Wdeclaration-after-statement -Wshadow -Wunsafe-loop-optimizations -Wpointer-arith -Wundef -Wcast-align -Wjump-misses-init -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wvariadic-macros -Wdisabled-optimization' \
-DCMAKE_CXX_FLAGS='-ansi -Wall -Werror -Wextra -Wpedantic -pedantic-errors -Wno-missing-field-initializers -Wdouble-promotion -Wformat=2 -Wno-format-nonliteral -Wformat-overflow=2 -Wmissing-include-dirs -Wshift-overflow=2 -Wunused -Wno-unused-parameter -Wunused-const-variable=1 -Wuse-after-free=3 -Wuseless-cast -Wuninitialized -Wstrict-overflow=2 -Wstringop-overflow=4 -Wstringop-truncation -Warray-bounds=2 -Wattribute-alias=2 -Wbidi-chars=any -Wduplicated-branches -Wduplicated-cond -Wtrampolines -Wshadow -Wunsafe-loop-optimizations -Wpointer-arith -Wundef -Wcast-align -Wcatch-value=3 -Wextra-semi -Wlogical-op -Wpacked -Wredundant-decls -Winline -Wvariadic-macros -Wdisabled-optimization' \
..
make -j$NUMCPUS --load-average=$NUMCPUS
popd
windows:
runs-on: windows-2025
steps:
- name: Set global environment variables
shell: bash
run: |
echo "BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >$GITHUB_ENV
- name: Check out code
uses: actions/checkout@v4
- name: Set up build
shell: bash
run: |
set -x
choco install -y nsis
git clone --depth=1 https://github.com/nathan818fr/vcvars-bash.git c:/vcvars-bash
git clone --depth=1 https://github.com/VirtualGL/buildscripts.git -b $BRANCH c:/buildscripts
- name: Configure GPG signing
if: ${{github.event_name != 'pull_request'}}
shell: bash
run: |
printf "${{secrets.GPG_KEY}}" | base64 --decode | gpg --batch --import -
echo "GPG_KEY_NAME=\"${{secrets.GPG_KEY_NAME}}\"" >c:/buildscripts/gpgsign
echo "GPG_KEY_ID=${{secrets.GPG_KEY_ID}}" >>c:/buildscripts/gpgsign
echo "GPG_KEY_PASS=${{secrets.GPG_KEY_PASS}}" >>c:/buildscripts/gpgsign
- name: Build
shell: bash
run: |
export PATH="/c/Program Files (x86)/NSIS/:$PATH"
export VSINSTALLDIR='C:\Program Files\Microsoft Visual Studio\2022\Enterprise\'
eval "$(c:/vcvars-bash/vcvarsall.sh amd64)"
echo INCLUDE=$INCLUDE
echo LIB=$LIB
echo PATH=$PATH
c:/buildscripts/buildvgl -d $GITHUB_WORKSPACE -b /c/vgl.nightly -v
mv /c/vgl.nightly/log-${{github.job}}.txt /c/vgl.nightly/files/
- name: Configure AWS
if: ${{github.event_name != 'pull_request'}}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
aws-region: ${{secrets.AWS_REGION}}
- name: Deploy
if: ${{github.event_name != 'pull_request' && !contains(github.ref, 'refs/tags/')}}
shell: bash
run: |
aws s3 sync --acl public-read --delete c:/vgl.nightly/files s3://virtualgl-pr/${{env.BRANCH}}/${{github.job}}/