Skip to content

Commit

Permalink
Run builds and tests directly on Fedora
Browse files Browse the repository at this point in the history
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 OpenSC#2661
  • Loading branch information
Jakuje committed Feb 7, 2023
1 parent 7e882ae commit 1b2ab29
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/setup-fedora.sh
Original file line number Diff line number Diff line change
@@ -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
36 changes: 36 additions & 0 deletions .github/workflows/fedora.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1b2ab29

Please sign in to comment.