-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cicd: Add github actions script for test builds
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
- Loading branch information
1 parent
1a08778
commit 2a9234e
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Check | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master", "stable-0.10" ] | ||
|
||
jobs: | ||
build-ubuntu-focal: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
run: | | ||
CFLAGS="-O3" ./autogen.sh --with-openssl --prefix=/usr --with-tpm2 | ||
make -j$(nproc) distcheck | ||
if [ $? -ne 0 ]; then | ||
for f in tests/*.log; do echo ">>>>>>> $f <<<<<<<"; tail -n 50 $f; done | ||
fi | ||
build-coveralls: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build for coveralls.io | ||
run: | | ||
./autogen.sh --with-openssl --prefix=/usr --with-tpm2 --enable-test-coverage | ||
make -j$(nproc) install | ||
make -j$(nproc) check | ||
git clone https://github.com/stefanberger/swtpm.git | ||
pushd swtpm | ||
rm -rf /dev/tpm* | ||
sudo apt -y install devscripts equivs python3-twisted expect \ | ||
libtasn1-dev socat findutils gnutls-dev gnutls-bin tss2 \ | ||
libjson-glib-dev | ||
./autogen.sh --with-gnutls --prefix=/usr | ||
SWTPM_TEST_EXPENSIVE=1 SWTPM_TEST_IBMTSS2=1 make -j$(nproc) check | ||
if [ $? -eq 0 ]; then | ||
uidgid="$(id -nu):$(id -ng)" | ||
sudo chown -R ${uidgid} ./ | ||
cpp-coveralls -b src -e tests -e swtpm --gcov-options '\-lp' | ||
fi | ||
popd | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
|
||
build-ubuntu-jammy: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
run: | | ||
./autogen.sh --with-openssl --prefix=/usr --with-tpm2 --enable-test-coverage --disable-use-openssl-functions | ||
make -j$(nproc) install | ||
make -j$(nproc) check | ||
git clone https://github.com/stefanberger/swtpm.git | ||
pushd swtpm | ||
rm -rf /dev/tpm* | ||
sudo apt -y install devscripts equivs python3-twisted expect \ | ||
libtasn1-dev socat findutils gnutls-dev gnutls-bin tss2 \ | ||
libjson-glib-dev | ||
./autogen.sh --with-gnutls --prefix=/usr | ||
SWTPM_TEST_EXPENSIVE=1 SWTPM_TEST_IBMTSS2=1 make -j$(nproc) check | ||
if [ $? -eq 0 ]; then | ||
uidgid="$(id -nu):$(id -ng)" | ||
sudo chown -R ${uidgid} ./ | ||
cpp-coveralls -b src -e tests -e swtpm --gcov-options '\-lp' | ||
fi | ||
popd | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |