From c17b158538b9f2cfa9264d140370b4fd82b441e8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 27 Sep 2022 03:26:55 +0200 Subject: [PATCH] Build inside container Mostly do it in order to be able to upload the entire /usr/local which is empty inside the minimal container but contains plenty of other stuff in the default GitHub Actions environment -- this is much simpler than uploading just the files installed by "make install" or installing them in some other directory. Also separate 32- and 64-bit builds. --- .github/workflows/build_msw_xml_libs.yml | 33 +++++++++++++++++------- scripts/install_deps.sh | 2 +- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_msw_xml_libs.yml b/.github/workflows/build_msw_xml_libs.yml index 99c6124..ba992d0 100644 --- a/.github/workflows/build_msw_xml_libs.yml +++ b/.github/workflows/build_msw_xml_libs.yml @@ -7,25 +7,38 @@ jobs: build-xml-libs: name: Build XML binaries runs-on: ubuntu-latest + container: debian:stable-slim + + strategy: + fail-fast: false + matrix: + include: + - name: 32 Bits + host: i686-w64-mingw32 + - name: 64 Bits + host: x86_64-w64-mingw32 + + env: + HOST: ${{ matrix.host }} + steps: - name: Checkout uses: actions/checkout@v2 - - name: Install Compiler - run: | - sudo apt-get update -qq - sudo apt-get install -qq --no-install-recommends g++-mingw-w64-i686 g++-mingw-w64-x86-64 - - - name: Build 32-bit Libraries + - name: Install Tools run: | - HOST=i686-w64-mingw32 ./scripts/install_deps.sh + apt-get update -qq + arch=`echo $HOST | sed -e 's/-w64-mingw32$//;s/_/-/'` + apt-get install -qq --no-install-recommends g++-mingw-w64-$arch make pkg-config wget - - name: Build 64-bit Libraries + - name: Build run: | - HOST=x86_64-w64-mingw32 ./scripts/install_deps.sh + # sudo doesn't work and is not necessary inside a container, so don't use it. + SUDO=env ./scripts/install_deps.sh - name: Upload uses: actions/upload-artifact@v3 with: - name: xml-libs + name: xmllibs-${{ matrix.host }} path: /usr/local + if-no-files-found: error diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index 16398c3..b361cbe 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -28,7 +28,7 @@ install_lib() { cd build-${HOST-native} ../configure $configure_args "$@" make --no-print-directory -j`nproc` - sudo make --no-print-directory install + ${SUDO-sudo} make --no-print-directory install cd ../.. }