Skip to content

Commit

Permalink
ci: Separate strict CI run
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakuje committed Jan 26, 2024
1 parent b37d3cd commit 86984b4
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/setup-fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
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++"
DEPS="make /usr/bin/xsltproc docbook-style-xsl autoconf automake libtool bash-completion vim-common softhsm openssl diffutils"

if [ "$1" == "clang" ]; then
DEPS="$DEPS clang"
else
DEPS="$DEPS gcc gcc-c++"
fi

# 64bit or 32bit dependencies
if [ "$1" == "ix86" ]; then
Expand Down
9 changes: 9 additions & 0 deletions .github/setup-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ if [ -x "/bin/sudo" ]; then
SUDO="sudo"
fi

if [ -f "/etc/fedora-release" ]; then
. .github/setup-fedora.sh
exit 0
fi

WINE_DEPS=""
# Generic dependencies
DEPS="docbook-xsl xsltproc gengetopt help2man pcscd check pcsc-tools libtool make autoconf autoconf-archive automake pkg-config git xxd openssl valgrind"

if [ "$1" == "clang" ]; then
DEPS="$DEPS clang"
fi

# 64bit or 32bit dependencies
if [ "$1" == "ix86" ]; then
DEPS="$DEPS gcc-multilib libpcsclite-dev:i386 libcmocka-dev:i386 libssl-dev:i386 zlib1g-dev:i386 libreadline-dev:i386 softhsm2:i386"
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/linux-strict.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
name: Linux (latest, strict)

on:
pull_request:
paths:
- '**.c'
- '**.h'
- '**.sh'
- .github/workflows/linux.yml
- '**.am'
- doc/**
- configure.ac
push:

permissions:
contents: read # to fetch code (actions/checkout)

# -Wno-incompatible-library-redeclaration -- strlcat and strlcpy compat
# functions make the build fail with
# incompatible redeclaration of library function 'strlcat'
# even if there is no implementation in Linux.
# Worth investigating
# -Wno-strict-prototypes -- is needed for the configure to pass
# otherwise it fails detect dlopen()
# -Wno-variadic-macros -- we are ok using the GNU extension in log.c
# -Wno-gnu-zero-variadic-macro-arguments -- related
# -Wno-incompatible-pointer-types-discards-qualifiers -- again with logging
# -Wno-unused-function -- the inline compat functions for openssl
# are included in files where they are needed and clang does not like it
# -Wformat-pedantic - this complains about missing casts to (void *) which is
# pointles
# -Wno-pedantic -- this complains about void and function pointers casts
# -Wno-incompatible-function-pointer-types -- this looks just buggy as it
# complains about missing const, which is there
env:
CLANG_CFLAGS: -Wshorten-64-to-32
CFLAGS: >-
-pedantic -Werror -Wall
-Wno-strict-prototypes -Wno-empty-translation-unit
-Wno-incompatible-library-redeclaration
-Wno-variadic-macros -Wno-unused-function
-Wno-incompatible-pointer-types-discards-qualifiers
-Wno-gnu-zero-variadic-macro-arguments
-Wno-format-pedantic
-Wno-pedantic
-Wno-incompatible-function-pointer-types
jobs:
build-strict:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name: [fedora, debian, ubuntu]
compiler: [clang, gcc]
include:
- name: fedora
container: fedora:rawhide
- name: debian
container: debian:sid
- name: ubuntu
container: ubuntu:latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v3
- run: .github/setup-linux.sh ${{ matrix.compiler }}
- run: .github/build.sh dist
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ env.CFLAGS }} ${{ matrix.compiler == 'clang' && env.CLANG_CFLAGS || '' }}
- name: Upload test logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ matrix.name }}-strict-test-logs
path: |
config.log
tests/*.log
src/tests/unittests/*.log

0 comments on commit 86984b4

Please sign in to comment.