From 68b7efb591fff5f94c6801ae7ba2b6e16515f467 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Wed, 4 Aug 2021 12:26:50 +0200 Subject: [PATCH] github actions: Unbreak migw builds --- .github/build.sh | 17 +++++++++-------- .github/setup-linux.sh | 7 ++++--- .github/workflows/linux.yml | 24 +++++++++++++++--------- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/build.sh b/.github/build.sh index 4e38b4fe..99ffbc86 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -32,13 +32,14 @@ if [ "$1" == "mingw" -o "$1" == "mingw32" ]; then unset CC unset CXX ./configure --host=$HOST --with-completiondir=/tmp --disable-openssl --disable-readline --disable-zlib --disable-notify --prefix=$PWD/win32/opensc || cat config.log; + make -j 2 + # no point in running tests on mingw +else + # normal procedure + ./configure --disable-dependency-tracking + make -j 2 + make check fi -# normal procedure -./configure --disable-dependency-tracking - -make -j 2 - -make check # this is broken in old ubuntu if [ "$1" == "dist" ]; then @@ -47,7 +48,7 @@ if [ "$1" == "dist" ]; then fi sudo make install - if [ "$1" == "mingw" -o "$1" == "mingw32" ]; then - wine "C:/Program Files (x86)/Inno Setup 5/ISCC.exe" win32/OpenSC.iss + # pack installed files + wine "C:/Program Files/Inno Setup 5/ISCC.exe" win32/OpenSC.iss fi diff --git a/.github/setup-linux.sh b/.github/setup-linux.sh index a0f2fb10..f20ade82 100755 --- a/.github/setup-linux.sh +++ b/.github/setup-linux.sh @@ -14,11 +14,12 @@ elif [ "$1" == "piv" -o "$1" == "isoapplet" -o "$1" == "gidsapplet" -o "$1" == " fi DEPS="$DEPS ant openjdk-8-jdk" elif [ "$1" == "mingw" -o "$1" == "mingw32" ]; then + DEPS="$DEPS wine wine32 xvfb wget" sudo dpkg --add-architecture i386 if [ "$1" == "mingw" ]; then - DEPS="$DEPS wine wine32 binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64 mingw-w64" + DEPS="$DEPS binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64 mingw-w64" elif [ "$1" == "mingw32" ]; then - DEPS="$DEPS wine wine32 binutils-mingw-w64-i686 gcc-mingw-w64-i686" + DEPS="$DEPS binutils-mingw-w64-i686 gcc-mingw-w64-i686" fi fi @@ -28,7 +29,7 @@ sudo apt-get update sudo apt-get install -y build-essential $DEPS if [ "$1" == "mingw" -o "$1" == "mingw32" ]; then - if [ ! -f "$(winepath 'C:/Program Files (x86)/Inno Setup 5/ISCC.exe')" ]; then + if [ ! -f "$(winepath 'C:/Program Files/Inno Setup 5/ISCC.exe')" ]; then /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 export DISPLAY=:99.0 [ -d isetup ] || mkdir isetup diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index cd7bc36b..89864425 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -38,11 +38,12 @@ jobs: - uses: actions/checkout@v2 - run: .github/setup-linux.sh mingw - run: .github/build.sh mingw - - uses: actions/cache@v2 - id: cache-build + - name: Cache build artifacts + uses: actions/upload-artifact@v2 with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} + name: opensc-build-mingw + path: + win32/Output/OpenSC*.exe build-mingw32: runs-on: ubuntu-latest @@ -50,11 +51,12 @@ jobs: - uses: actions/checkout@v2 - run: .github/setup-linux.sh mingw32 - run: .github/build.sh mingw32 - - uses: actions/cache@v2 - id: cache-build + - name: Cache build artifacts + uses: actions/upload-artifact@v2 with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} + name: opensc-build-mingw32 + path: + win32/Output/OpenSC*.exe test-piv: runs-on: ubuntu-18.04 @@ -150,7 +152,7 @@ jobs: push-artifacts: runs-on: ubuntu-latest - needs: [build, build-mingw, build-mingw32] + needs: [build, build-mingw] steps: - uses: actions/checkout@v2 - uses: actions/cache@v2 @@ -158,6 +160,10 @@ jobs: with: path: ./* key: ${{ runner.os }}-${{ github.sha }} + - name: Pull mingw build artifacts + uses: actions/download-artifact@v2 + with: + name: opensc-build-mingw - run: git config --global user.email "builds@github.com" - run: git config --global user.name "Github Actions"; - run: .github/push_artifacts.sh "Github Actions ${GITHUB_REF}"