Skip to content

Commit

Permalink
ci: Add github actions to replace Travis
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Berger <[email protected]>
  • Loading branch information
stefanberger committed Dec 14, 2024
1 parent c5c4af9 commit bdccc50
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/actions/test-swtpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
runs:
using: "composite"
steps:
- name: Build and test
shell: bash
run: |
sudo apt-get -y install automake autoconf libtool libssl-dev sed make gawk \
sed bash dh-exec python3-pip libfuse-dev libglib2.0-dev libjson-glib-dev \
libgmp-dev expect libtasn1-dev socat findutils gnutls-dev gnutls-bin softhsm2 \
libseccomp-dev tss2
if [ ! -d libtpms ]; then
git clone https://github.com/stefanberger/libtpms;
fi
pushd libtpms
if [ -n "${LIBTPMS_GIT_CHECKOUT}" ]; then
git checkout "${LIBTPMS_GIT_CHECKOUT}" -b testing;
fi
CFLAGS="${LIBTPMS_CFLAGS:--g -O2}" LDFLAGS="${LIBTPMS_LDFLAGS}" \
./autogen.sh --with-openssl --prefix=${LIBTPMS_PREFIX:-/usr} --with-tpm2 ${LIBTPMS_CONFIG}
make -j$(${NPROC:-nproc})
sudo make install
popd
./autogen.sh ${CONFIG}
${SUDO} make clean
export SWTPM_TEST_EXPENSIVE=${SWTPM_TEST_EXPENSIVE:-1}
export SWTPM_TEST_IBMTSS2=${SWTPM_TEST_IBMTSS2:-0}
export SWTPM_TEST_STORE_VOLATILE=${SWTPM_TEST_STORE_VOLATILE:-0}
${SUDO} make -j$(${NPROC:-nproc}) ${CHECK} VERBOSE=1
if [ -n "${RUN_TEST}" ]; then
sudo make install
sudo ${PREFIX}/bin/swtpm_setup
--tpmstate /tmp --create-ek-cert --create-platform-cert --tpm2
fi
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check

on:
pull_request:
branches: [ "master", "stable-*" ]

jobs:
test-1:
runs-on: ubuntu-20.04
env:
PREFIX: "/usr"
CONFIG: "--with-openssl --prefix=${PREFIX}"
CHECK: "distcheck"
RUN_TEST: "1"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: My composite action
uses: ./.github/actions/test-swtpm

0 comments on commit bdccc50

Please sign in to comment.