Update build.yml #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: [push, pull_request] | |
env: | |
APT_SET_CONF: | | |
echo "Acquire::Retries \"3\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom | |
echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom | |
echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom | |
CCACHE_SETTINGS: | | |
ccache --max-size=150M | |
ccache --set-config=compression=true | |
jobs: | |
build-windows: | |
runs-on: ubuntu-20.04 | |
env: | |
CCACHE_TEMPDIR: /tmp/.ccache-temp | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- name: "build-depends-windows-x64" | |
host: "x86_64-w64-mingw32" | |
packages: "cmake python3 g++-mingw-w64-x86-64 qttools5-dev-tools" | |
name: ${{ matrix.toolchain.name }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
# Most volatile cache | |
- name: ccache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.ccache | |
key: ccache-${{ matrix.toolchain.host }}-${{ github.sha }} | |
restore-keys: ccache-${{ matrix.toolchain.host }}- | |
# Less volatile cache | |
- name: depends cache | |
uses: actions/cache@v3 | |
with: | |
path: contrib/depends/built | |
key: depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }} | |
restore-keys: | | |
depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }} | |
depends-${{ matrix.toolchain.host }}- | |
# Static cache | |
- name: set apt conf | |
run: ${{env.APT_SET_CONF}} | |
- name: install dependencies | |
run: sudo apt update; sudo apt -y install libboost-all-dev libsodium-dev build-essential libtool cmake autotools-dev automake pkg-config bsdmainutils curl git ca-certificates ccache ${{ matrix.toolchain.packages }} | |
- name: prepare w64-mingw32 | |
if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' }} | |
run: | | |
sudo update-alternatives --set ${{ matrix.toolchain.host }}-g++ $(which ${{ matrix.toolchain.host }}-g++-posix) | |
sudo update-alternatives --set ${{ matrix.toolchain.host }}-gcc $(which ${{ matrix.toolchain.host }}-gcc-posix) | |
- name: build | |
run: | | |
${{env.CCACHE_SETTINGS}} | |
make depends target=${{ matrix.toolchain.host }} cmake_opts=${{ matrix.toolchain.cmake_opts }} -j2 | |
- uses: actions/upload-artifact@v3 | |
if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' || matrix.toolchain.host == 'x86_64-unknown-linux-gnu' || matrix.toolchain.host == 'aarch64-linux-gnu' || 'arm-linux-gnueabihf' }} | |
with: | |
name: ${{ matrix.toolchain.name }} | |
path: | | |
/home/runner/work/*/*/build/${{ matrix.toolchain.host }}/release/bin/* |