Skip to content

Commit 90f18e8

Browse files
committed
Linux: Add Github workflow to build .deb files and test generated binaries
1 parent ab1b989 commit 90f18e8

File tree

1 file changed

+167
-0
lines changed

1 file changed

+167
-0
lines changed

.github/workflows/build-linux.yml

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
name: Build and test Linux
2+
3+
on:
4+
push:
5+
branches: [ "CI" ]
6+
paths:
7+
- 'src/Build/Include/Makefile.inc'
8+
- 'src/Build/CMakeLists.txt'
9+
- 'src/Common/*.h'
10+
- 'src/Common/*.cpp'
11+
- 'src/Common/*.c'
12+
- 'src/Core/**'
13+
- 'src/Crypto/**'
14+
- 'src/Driver/Fuse/**'
15+
- 'src/Main/**'
16+
- 'src/PKCS11/**'
17+
- 'src/Platform/**'
18+
- 'src/Resources/**'
19+
- 'src/Setup/Linux/**'
20+
- 'src/Volume/**'
21+
- 'src/Makefile'
22+
- '.github/workflows/build-linux.yml'
23+
pull_request:
24+
branches: [ "CI" ]
25+
paths:
26+
- 'src/Build/Include/Makefile.inc'
27+
- 'src/Build/CMakeLists.txt'
28+
- 'src/Common/*.h'
29+
- 'src/Common/*.cpp'
30+
- 'src/Common/*.c'
31+
- 'src/Core/**'
32+
- 'src/Crypto/**'
33+
- 'src/Driver/Fuse/**'
34+
- 'src/Main/**'
35+
- 'src/PKCS11/**'
36+
- 'src/Platform/**'
37+
- 'src/Resources/**'
38+
- 'src/Setup/Linux/**'
39+
- 'src/Volume/**'
40+
- 'src/Makefile'
41+
- '.github/workflows/build-linux.yml'
42+
43+
concurrency:
44+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
45+
cancel-in-progress: true
46+
47+
env:
48+
WXWIDGETS_VERSION: 3.2.5
49+
50+
jobs:
51+
ubuntu-build:
52+
53+
runs-on: ubuntu-22.04
54+
timeout-minutes: 30
55+
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
- name: Cache wxWidgets
61+
uses: actions/cache@v3
62+
id: cache-wxwidgets
63+
with:
64+
path: /tmp/wxWidgets-${{ env.WXWIDGETS_VERSION }}
65+
key: wxWidgets-${{ env.WXWIDGETS_VERSION }}-${{ hashFiles('src/Build/build_cmake_deb.sh', 'src/Makefile') }}
66+
restore-keys: |
67+
wxWidgets-${{ env.WXWIDGETS_VERSION }}-
68+
69+
- name: Install dependencies
70+
run: sudo apt-get update && sudo apt-get install -y wget tar libpcsclite-dev libfuse-dev yasm libgtk-3-dev libwxgtk3.0-gtk3-dev libayatana-appindicator3-dev cmake debhelper
71+
72+
- name: Download and extract wxWidgets to /tmp
73+
if: steps.cache-wxwidgets.outputs.cache-hit != 'true'
74+
run: |
75+
wget https://github.com/wxWidgets/wxWidgets/releases/download/v${{ env.WXWIDGETS_VERSION }}/wxWidgets-${{ env.WXWIDGETS_VERSION }}.tar.bz2 -O /tmp/wxWidgets-${{ env.WXWIDGETS_VERSION }}.tar.bz2
76+
tar -xjf /tmp/wxWidgets-${{ env.WXWIDGETS_VERSION }}.tar.bz2 -C /tmp/wxWidgets-${{ env.WXWIDGETS_VERSION }} --strip-components=1
77+
78+
- name: Build VeraCrypt .deb packages
79+
run: |
80+
chmod +x src/Build/build_cmake_deb.sh
81+
src/Build/build_cmake_deb.sh INDICATOR
82+
83+
- name: Upload GUI .deb packages
84+
uses: actions/upload-artifact@v3
85+
with:
86+
name: veracrypt-gui-debs
87+
path: /tmp/VeraCrypt_Packaging/GUI/Packaging/veracrypt-*.{deb,sha256}
88+
89+
- name: Upload Console .deb packages
90+
uses: actions/upload-artifact@v3
91+
with:
92+
name: veracrypt-console-debs
93+
path: /tmp/VeraCrypt_Packaging/Console/Packaging/veracrypt-console-*.{deb,sha256}
94+
95+
- name: Install and test VeraCrypt GUI .deb packages
96+
run: |
97+
sudo apt install -y /tmp/VeraCrypt_Packaging/GUI/Packaging/veracrypt-*.deb
98+
veracrypt --text --test && veracrypt --text --version
99+
sudo veracrypt --text --non-interactive Tests/test.sha256.hc --hash sha256 --slot 1 --password test --mount-options=ro
100+
sudo veracrypt --text --non-interactive Tests/test.sha512.hc --hash sha512 --slot 2 --password test --mount-options=ro
101+
sudo veracrypt --text --non-interactive Tests/test.streebog.hc --hash streebog --slot 3 --password test --mount-options=ro
102+
sudo veracrypt --text --non-interactive Tests/test.whirlpool.hc --hash whirlpool --slot 4 --password test --mount-options=ro
103+
sudo veracrypt --text --list
104+
echo -n "dummy" > /tmp/expected_content.txt
105+
if cmp -s /media/veracrypt1/dummy.txt /tmp/expected_content.txt; then
106+
echo "Content of test.sha256.hc is valid."
107+
else
108+
echo "Content of test.sha256.hc is invalid!"
109+
exit 1
110+
fi
111+
if cmp -s /media/veracrypt2/dummy.txt /tmp/expected_content.txt; then
112+
echo "Content of test.sha512.hc is valid."
113+
else
114+
echo "Content of test.sha512.hc is invalid!"
115+
exit 1
116+
fi
117+
if cmp -s /media/veracrypt3/dummy.txt /tmp/expected_content.txt; then
118+
echo "Content of test.streebog.hc is valid."
119+
else
120+
echo "Content of test.streebog.hc is invalid!"
121+
exit 1
122+
fi
123+
if cmp -s /media/veracrypt4/dummy.txt /tmp/expected_content.txt; then
124+
echo "Content of test.whirlpool.hc is valid."
125+
else
126+
echo "Content of test.whirlpool.hc is invalid!"
127+
exit 1
128+
fi
129+
sudo veracrypt -d
130+
sudo apt remove -y veracrypt
131+
132+
- name: Install and test VeraCrypt Console .deb packages
133+
run: |
134+
sudo apt install -y /tmp/VeraCrypt_Packaging/Console/Packaging/veracrypt-console-*.deb
135+
veracrypt --test && veracrypt --version
136+
sudo veracrypt --non-interactive Tests/test.sha256.hc --hash sha256 --slot 1 --password test --mount-options=ro
137+
sudo veracrypt --non-interactive Tests/test.sha512.hc --hash sha512 --slot 2 --password test --mount-options=ro
138+
sudo veracrypt --non-interactive Tests/test.streebog.hc --hash streebog --slot 3 --password test --mount-options=ro
139+
sudo veracrypt --non-interactive Tests/test.whirlpool.hc --hash whirlpool --slot 4 --password test --mount-options=ro
140+
sudo veracrypt --list
141+
echo -n "dummy" > /tmp/expected_content.txt
142+
if cmp -s /media/veracrypt1/dummy.txt /tmp/expected_content.txt; then
143+
echo "Content of test.sha256.hc is valid."
144+
else
145+
echo "Content of test.sha256.hc is invalid!"
146+
exit 1
147+
fi
148+
if cmp -s /media/veracrypt2/dummy.txt /tmp/expected_content.txt; then
149+
echo "Content of test.sha512.hc is valid."
150+
else
151+
echo "Content of test.sha512.hc is invalid!"
152+
exit 1
153+
fi
154+
if cmp -s /media/veracrypt3/dummy.txt /tmp/expected_content.txt; then
155+
echo "Content of test.streebog.hc is valid."
156+
else
157+
echo "Content of test.streebog.hc is invalid!"
158+
exit 1
159+
fi
160+
if cmp -s /media/veracrypt4/dummy.txt /tmp/expected_content.txt; then
161+
echo "Content of test.whirlpool.hc is valid."
162+
else
163+
echo "Content of test.whirlpool.hc is invalid!"
164+
exit 1
165+
fi
166+
sudo veracrypt -d
167+
sudo apt remove -y veracrypt

0 commit comments

Comments
 (0)