1
0
Fork 0

Fix: [Actions] cleanup ci-build workflow to be up-to-date (#8375)

Also, while at it, make it more like the upcoming release-workflow,
so they look a lot more similar.

Functional it should be the same, except that Windows should
now also output when a test fails.
pull/8377/head
Patric Stout 2020-12-13 22:32:44 +01:00 committed by GitHub
parent 5d0331ecdc
commit abb746fae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 135 additions and 63 deletions

View File

@ -6,29 +6,38 @@ on:
branches: branches:
- master - master
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs: jobs:
linux: linux:
name: Linux name: Linux
runs-on: ubuntu-20.04
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
compiler: [clang, gcc]
include: include:
- compiler: clang - compiler: clang
cxxcompiler: clang++ cxxcompiler: clang++
- compiler: gcc - compiler: gcc
cxxcompiler: g++ cxxcompiler: g++
runs-on: ubuntu-20.04
env: env:
CTEST_OUTPUT_ON_FAILURE: 1
CC: ${{ matrix.compiler }} CC: ${{ matrix.compiler }}
CXX: ${{ matrix.cxxcompiler }} CXX: ${{ matrix.cxxcompiler }}
steps: steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies - name: Install dependencies
run: | run: |
echo "::group::Update apt"
sudo apt-get update sudo apt-get update
echo "::endgroup::"
echo "::group::Install dependencies"
sudo apt-get install -y --no-install-recommends \ sudo apt-get install -y --no-install-recommends \
libfontconfig-dev \ libfontconfig-dev \
libicu-dev \ libicu-dev \
@ -39,104 +48,167 @@ jobs:
libxdg-basedir-dev \ libxdg-basedir-dev \
zlib1g-dev \ zlib1g-dev \
# EOF # EOF
echo "::endgroup::"
- name: Checkout env:
uses: actions/checkout@v2 DEBIAN_FRONTEND: noninteractive
- name: Get OpenGFX - name: Get OpenGFX
run: | run: |
mkdir -p ~/.local/share/openttd/baseset mkdir -p ~/.local/share/openttd/baseset
cd ~/.local/share/openttd/baseset cd ~/.local/share/openttd/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip rm -f opengfx-all.zip
- name: CMake - name: Install GCC problem matcher
run: mkdir build && cd build && cmake .. uses: ammaraskar/gcc-problem-matcher@master
- uses: ammaraskar/gcc-problem-matcher@master
- name: Build - name: Build
run: cd build && make -j2
- name: Test
run: cd build && make -j2 test
windows:
name: Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x86, x64]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare vcpkg (with cache)
uses: lukka/run-vcpkg@v4
with:
vcpkgDirectory: 'c:/vcpkg'
doNotUpdateVcpkg: true
vcpkgArguments: 'liblzma libpng lzo zlib'
vcpkgTriplet: '${{ matrix.arch }}-windows-static'
- uses: ammaraskar/msvc-problem-matcher@master
- name: 'Build'
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtBasic
useVcpkgToolchainFile: true
buildDirectory: '${{ runner.workspace }}/build'
- name: Install OpenGFX
run: | run: |
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset" mkdir build
cd "C:/Users/Public/Documents/OpenTTD/baseset" cd build
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
unzip opengfx-all.zip echo "::group::CMake"
rm -f opengfx-all.zip cmake ..
shell: bash echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
make -j$(nproc)
echo "::endgroup::"
- name: Test - name: Test
run: | run: |
cd ${{ runner.workspace }}/build cd build
ctest -C Debug make -j$(nproc) test
macos: macos:
name: Mac OS name: Mac OS
runs-on: macos-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix:
include:
- arch: x64
full_arch: x86_64
runs-on: macos-latest
env: env:
CTEST_OUTPUT_ON_FAILURE: 1
MACOSX_DEPLOYMENT_TARGET: 10.9 MACOSX_DEPLOYMENT_TARGET: 10.9
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install dependencies - name: Prepare vcpkg (with cache)
run: brew install pkg-config lzo xz libpng freetype uses: lukka/run-vcpkg@v6
env: with:
HOMEBREW_NO_AUTO_UPDATE: 1 vcpkgDirectory: '/usr/local/share/vcpkg'
doNotUpdateVcpkg: true
vcpkgArguments: 'freetype liblzma lzo'
vcpkgTriplet: '${{ matrix.arch }}-osx'
- name: Install OpenGFX - name: Install OpenGFX
run: | run: |
mkdir -p ~/Documents/OpenTTD/baseset mkdir -p ~/Documents/OpenTTD/baseset
cd ~/Documents//OpenTTD/baseset cd ~/Documents//OpenTTD/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip rm -f opengfx-all.zip
- name: CMake - name: Install GCC problem matcher
run: mkdir build && cd build && cmake .. uses: ammaraskar/gcc-problem-matcher@master
- uses: ammaraskar/gcc-problem-matcher@master
- name: Build - name: Build
run: cd build && make -j2 run: |
mkdir build
cd build
echo "::group::CMake"
cmake ${GITHUB_WORKSPACE} \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.full_arch }} \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-osx \
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(sysctl -n hw.logicalcpu) cores"
make -j$(sysctl -n hw.logicalcpu)
echo "::endgroup::"
- name: Test - name: Test
run: cd build && make -j2 test run: |
cd build
make -j$(sysctl -n hw.logicalcpu) test
windows:
name: Windows
strategy:
fail-fast: false
matrix:
include:
- arch: x86
- arch: x64
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare vcpkg (with cache)
uses: lukka/run-vcpkg@v6
with:
vcpkgDirectory: 'c:/vcpkg'
doNotUpdateVcpkg: true
vcpkgArguments: 'liblzma libpng lzo zlib'
vcpkgTriplet: '${{ matrix.arch }}-windows-static'
- name: Install OpenGFX
shell: bash
run: |
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset"
cd "C:/Users/Public/Documents/OpenTTD/baseset"
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
- name: Build
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
useVcpkgToolchainFile: true
buildDirectory: '${{ github.workspace }}/build'
cmakeAppendedArgs: ' -GNinja'
- name: Test
shell: bash
run: |
cd ${GITHUB_WORKSPACE}/build
ctest -C Debug