From 1b2ab29c908e559c3919a443ac5da7f6f7e4cfb3 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 26 Jan 2023 10:45:39 +0100 Subject: [PATCH] Run builds and tests directly on Fedora The default ubuntu images on the Github are more frequently broken than working for this use case and Fedora was suggested as an easy replacement. Based on suggestion from https://github.com/OpenSC/OpenSC/pull/2661 --- .github/setup-fedora.sh | 21 +++++++++++++++++++++ .github/workflows/fedora.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100755 .github/setup-fedora.sh create mode 100644 .github/workflows/fedora.yml diff --git a/.github/setup-fedora.sh b/.github/setup-fedora.sh new file mode 100755 index 0000000000..d194e6259e --- /dev/null +++ b/.github/setup-fedora.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -ex -o xtrace + +# Generic dependencies +DEPS="make /usr/bin/xsltproc docbook-style-xsl autoconf automake libtool gcc bash-completion vim-common softhsm openssl diffutils gcc-c++" + +# 64bit or 32bit dependencies +if [ "$1" == "ix86" ]; then + DEPS="$DEPS pcsc-lite-devel*.i686 readline-devel*.i686 openssl-devel*.i686 zlib-devel*.i686 libcmocka-devel*.i686 glibc-devel*i686" +else + DEPS="$DEPS pcsc-lite-devel readline-devel openssl-devel zlib-devel libcmocka-devel" +fi + +sudo dnf install -y $DEPS + +# The test-pkcs11-tool-unwrap-wrap-test.sh is broken in Fedora for some reason +sed -i -e '/XFAIL_TESTS/,$ { + s/XFAIL_TESTS.*/XFAIL_TESTS=test-pkcs11-tool-test-threads.sh test-pkcs11-tool-test.sh test-pkcs11-tool-unwrap-wrap-test.sh/ + q +}' tests/Makefile.am diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml new file mode 100644 index 0000000000..c7ec024e9f --- /dev/null +++ b/.github/workflows/fedora.yml @@ -0,0 +1,36 @@ +name: Fedora Linux + +on: + pull_request: + paths: + - '**.c' + - '**.h' + - .github/workflows/fedora.yml + - .github/setup-fedora.sh + - .github/build.sh + - .github/push-artifacts.sh + - '**.am' + - doc/** + push: + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + fedora: + runs-on: ubuntu-latest + container: + image: fedora:latest + steps: + - uses: actions/checkout@v2 + - run: .github/setup-fedora.sh + - run: .github/build.sh dist + + fedora-ix86: + runs-on: ubuntu-latest + container: + image: fedora:latest + steps: + - uses: actions/checkout@v2 + - run: .github/setup-fedora.sh ix86 + - run: .github/build.sh ix86