Skip to content
Permalink
Browse files

cache mxe builds (#41472)

  • Loading branch information
3nids authored and nyalldawson committed Feb 17, 2021
1 parent 8f3eeb3 commit cc4538bb20952511fbe1c8a8700a91e048d4854d
Showing with 60 additions and 18 deletions.
  1. +46 −2 .github/workflows/mxe.yml
  2. +12 −4 ms-windows/mxe/build-mxe.sh
  3. +0 −11 ms-windows/mxe/build.sh
  4. +2 −1 ms-windows/mxe/mxe.Dockerfile
@@ -27,14 +27,58 @@ on:
jobs:
build:

env:
CCACHE_DIR: ${{ github.workspace }}/.ccache

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build Dockerfile
run: |
cd ms-windows/mxe
docker build -f mxe.Dockerfile --tag mxe-qt5-builder:current .
- name: Prepare build cache for pull request
uses: pat-s/always-upload-cache@v2.1.3
if: github.event_name == 'pull_request'
with:
path: ${{ github.workspace }}/.ccache
key: mxe-ccache-${{ github.actor }}-${{ github.head_ref }}-${{ github.sha }}
# The head_ref or source branch of the pull request in a workflow run.
# The base_ref or target branch of the pull request in a workflow run.
restore-keys: |
mxe-ccache-${{ github.actor }}-${{ github.head_ref }}-
mxe-ccache-${{ github.base_ref }}-
mxe-ccache-refs/heads/master-
- name: Prepare build cache for branch/tag
# use a fork of actions/cache@v2 to upload cache even when the build or test failed
uses: pat-s/always-upload-cache@v2.1.3
if: github.event_name != 'pull_request'
with:
path: ${{ github.workspace }}/.ccache
# The branch or tag ref that triggered the workflow run. For branches this in the format refs/heads/<branch_name>, and for tags it is refs/tags/<tag_name>
key: mxe-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
mxe-ccache-${{ github.ref }}-
mxe-ccache-refs/heads/master-
- name: Cross build with MXE
run: cd $GITHUB_WORKSPACE && ms-windows/mxe/build.sh
run: |
mkdir -p ${{ github.workspace }}/.ccache
docker run -v ${GITHUB_WORKSPACE}:/root/QGIS \
-w /root/QGIS \
--env CCACHE_DIR=/root/QGIS/.ccache \
mxe-qt5-builder:current \
/root/QGIS/ms-windows/mxe/build-mxe.sh
- name: Rename artifact
run: cd $GITHUB_WORKSPACE && mv qgis-mxe-release-*.zip qgis-mxe-release.zip
run: |
cd $GITHUB_WORKSPACE
mv qgis-mxe-release-*.zip qgis-mxe-release.zip
- name: Upload build
uses: actions/upload-artifact@v1
with:
@@ -50,9 +50,6 @@ TARGET=x86_64-w64-mingw32.shared
# Set base path for all tools
export PATH=${PATH}:${MXE}/usr/bin

# Fix CCACHE directory
export CCACHE_DIR=${PWD}/.ccache

if [ ! -e ${CCACHE_DIR} ]; then
mkdir -p ${CCACHE_DIR}
fi
@@ -73,9 +70,12 @@ cd ${BUILD_DIR}

if [[ "$COMMAND" != *"package"* ]]; then

echo "::group::compile QGIS"

${MXE}/usr/bin/${TARGET}-cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
-DCMAKE_INSTALL_PREFIX=${RELEASE_DIR} \
-DUSE_CCACHE=ON \
-DENABLE_TESTS=OFF \
-DWITH_QSPATIALITE=ON \
-DWITH_APIDOC=OFF \
@@ -90,8 +90,15 @@ if [[ "$COMMAND" != *"package"* ]]; then

make -j16 install

echo "::endgroup::"

#echo "ccache statistics"
ccache -s

fi

echo "::group::package"

# Collect deps

$PYDEPLOY --build=${RELEASE_DIR} --objdump=${MXE}/usr/bin/${TARGET}-objdump ${RELEASE_DIR}/qgis.exe
@@ -108,7 +115,6 @@ __TXT__

# First cleanup
rm -rf ${BUILD_DIR}
rm -rf ${CCACHE_DIR}

# Make the zip

@@ -119,6 +125,8 @@ zip -r -m ${ZIP_NAME} $(basename ${RELEASE_DIR})
# Second cleanup
rm -rf ${RELEASE_DIR}

echo "::endgroup::"

popd

echo "Release in $ZIP_NAME ready."

This file was deleted.

@@ -10,7 +10,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
software-properties-common \
lsb-release \
gpg-agent \
python3-distutils
python3-distutils \
ccache

RUN apt-key adv \
--keyserver keyserver.ubuntu.com \

0 comments on commit cc4538b

Please sign in to comment.