Skip to content

Commit c0bc7d9

Browse files
authored
Merge pull request #244 from aidangarske/libcryptsetup-worklfow
Add libcryptsetup github workflow
2 parents b993955 + 453f249 commit c0bc7d9

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Libcryptsetup Tests
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
build_wolfprovider:
17+
uses: ./.github/workflows/build-wolfprovider.yml
18+
with:
19+
wolfssl_ref: ${{ matrix.wolfssl_ref }}
20+
openssl_ref: ${{ matrix.openssl_ref }}
21+
strategy:
22+
matrix:
23+
wolfssl_ref: ['v5.8.0-stable', 'master']
24+
openssl_ref: ['openssl-3.5.0']
25+
26+
test_cryptsetup:
27+
runs-on: ubuntu-22.04
28+
needs: build_wolfprovider
29+
# This should be a safe limit for the tests to run.
30+
timeout-minutes: 20
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
cryptsetup_ref: ['v2.6.1']
35+
wolfssl_ref: ['v5.8.0-stable', 'master']
36+
openssl_ref: ['openssl-3.5.0']
37+
force_fail: ['WOLFPROV_FORCE_FAIL=1', '']
38+
39+
steps:
40+
- name: Checkout wolfProvider
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 1
44+
45+
- name: Retrieving wolfSSL/wolfProvider from cache
46+
uses: actions/cache/restore@v4
47+
id: wolfprov-cache
48+
with:
49+
path: |
50+
wolfssl-install
51+
wolfprov-install
52+
openssl-install/lib64
53+
openssl-install/include
54+
openssl-install/bin
55+
56+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
57+
fail-on-cache-miss: true
58+
59+
- name: Install dependencies
60+
run: |
61+
sudo apt-get update
62+
sudo apt-get install -y \
63+
build-essential autoconf asciidoctor gettext autopoint libtool \
64+
pkg-config uuid-dev libdevmapper-dev libpopt-dev libjson-c-dev \
65+
libargon2-dev
66+
67+
- name: Checkout cryptsetup
68+
uses: actions/checkout@v4
69+
with:
70+
repository: mbroz/cryptsetup
71+
path: cryptsetup
72+
ref: ${{ matrix.cryptsetup_ref }}
73+
74+
- name: Checkout OSP
75+
uses: actions/checkout@v4
76+
with:
77+
repository: wolfssl/osp
78+
path: osp
79+
fetch-depth: 1
80+
- run: |
81+
cd cryptsetup
82+
patch -p1 < $GITHUB_WORKSPACE/osp/wolfProvider/libcryptsetup/libcryptsetup-${{ matrix.cryptsetup_ref }}-wolfprov.patch
83+
84+
- name: Build cryptsetup
85+
working-directory: cryptsetup
86+
run: |
87+
./autogen.sh
88+
./configure --enable-static \
89+
--with-crypto-backend=openssl \
90+
--disable-ssh-token \
91+
--with-openssl-includes=$GITHUB_WORKSPACE/openssl-install/include \
92+
--with-openssl-libs=$GITHUB_WORKSPACE/openssl-install/lib64
93+
make -j$(nproc)
94+
95+
- name: Run cryptsetup tests
96+
working-directory: cryptsetup
97+
run: |
98+
source $GITHUB_WORKSPACE/scripts/env-setup
99+
export ${{ matrix.force_fail }}
100+
101+
make check 2>&1 | tee cryptsetup-test.log
102+
TEST_RESULT=$(grep -q "All 10 tests passed" cryptsetup-test.log && echo "0" || echo "1")
103+
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} cryptsetup

0 commit comments

Comments
 (0)