1
0
Fork 0

Expand CI coverage and move actions into scripts

This change makes a couple changes to the CI workflow:
 - Adds more compiler coverage:
     - gcc to MacOS (see note below)
     - 32 and 64bit gcc and clang to Windows

 - With more builds, this separates them into per-OS workflow YAMLs
   (laying the foundation for more build environments: BSD? DOS? ... )

 - Moves all functional commands from GitHub-syntax-YAML into scripts,
   which (besides eliminating repeated code), now serve a dual-purpose
   of being runnable outside of GitHub.
     - One script takes care of listing dependent packages for the given
       runtime environment
     - Another script takes care of configuring and building

These scripts can be leveraged by a nightly build & asset generator in
the future.

Note: adding GCC to MacOS is now "correct" from a build perspective,
however to keep this PR focussed on the CI workflow I have not included
the coreMIDI / AppleBlocks code-fixes here (so for now, the gcc macOS
builds will fail; we will merge the coreMIDI / AppleBlocks later
depending on how upstream wants to handle it).
This commit is contained in:
krcroft 2019-10-26 11:41:33 -07:00
parent b87966cd11
commit 86aabad5da
No known key found for this signature in database
GPG key ID: 94D8F8D0D171A64B
9 changed files with 1176 additions and 144 deletions

View file

@ -1,142 +0,0 @@
name: "Build"
on: [push]
jobs:
build_gcc9:
name: "GCC 9 (ubuntu-18.04)"
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: "Log environment"
run: ./scripts/log-env.sh
- run: sudo apt update
- name: "Install packages"
run: sudo apt-get install g++-9 libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev
- name: "Build"
env:
CC: gcc-9
CXX: g++-9
run: |
# build steps
set -x
$CXX --version
./autogen.sh
./configure CXXFLAGS="-Wall -fdiagnostics-color=always"
make -j "$(nproc)" |& tee build.log
- name: "Summarize warnings"
run: python3 ./scripts/count-warnings.py build.log
build_gcc_ubuntu:
name: "GCC"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-16.04]
steps:
- uses: actions/checkout@v1
- name: "Log environment"
run: ./scripts/log-env.sh
- run: sudo apt update
- name: "Install packages"
run: sudo apt-get install libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev
- name: "Build"
run: |
# build steps
set -x
g++ --version
./autogen.sh
./configure CXXFLAGS="-Wall -fdiagnostics-color=always"
make -j "$(nproc)" |& tee build.log
- name: "Summarize warnings"
run: python3 ./scripts/count-warnings.py build.log
build_clang:
name: "Clang (ubuntu-18.04)"
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: "Log environment"
run: ./scripts/log-env.sh
- run: sudo apt update
- name: "Install packages"
run: sudo apt-get install libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev
- name: "Build"
env:
CC: clang
CXX: clang++
run: |
# build steps
set -x
$CXX --version
./autogen.sh
./configure CXXFLAGS="-Wall"
make -j "$(nproc)" |& tee build.log
- name: "Summarize warnings"
run: python3 ./scripts/count-warnings.py build.log
build_macos:
name: "Clang (macOS-10.14)"
runs-on: macOS-10.14
steps:
- uses: actions/checkout@v1
- name: "Log environment"
run: ./scripts/log-env.sh
- run: brew update
- name: "Install packages"
run: brew install automake libpng sdl sdl_net sdl_sound
- name: "Build"
run: |
# build steps
set -x
clang++ --version
./autogen.sh
./configure CXXFLAGS="-Wall"
make -j "$(sysctl -n hw.physicalcpu)" 2>&1 | tee build.log
- name: "Summarize warnings"
run: python3 ./scripts/count-warnings.py build.log
build_msvc_debug:
name: "MSVC 14 Debug (win-2019)"
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
- name: "Log environment"
shell: pwsh
run: .\scripts\log-env.ps1
- name: "Install packages"
shell: pwsh
run: |
vcpkg install libpng sdl1 sdl1-net
vcpkg integrate install
- name: "Build"
shell: pwsh
env:
PATH: '${env:PATH};C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64'
run: |
# build steps
cd visualc_net
MSBuild -m dosbox.sln -p:Configuration=Debug
build_msvc_release:
name: "MSVC 14 Release (win-2019)"
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
- name: "Log environment"
shell: pwsh
run: .\scripts\log-env.ps1
- name: "Install packages"
shell: pwsh
run: |
vcpkg install libpng sdl1 sdl1-net
vcpkg integrate install
- name: "Build"
shell: pwsh
env:
PATH: '${env:PATH};C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64'
run: |
# build steps
cd visualc_net
MSBuild -m dosbox.sln -p:Configuration=Release

48
.github/workflows/linux.yml vendored Normal file
View file

@ -0,0 +1,48 @@
name: "Linux builds"
on: push
jobs:
build_ubuntu_gcc9:
name: "GCC 9 (ubuntu-18.04)"
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: "Log environment"
run: ./scripts/log-env.sh
- name: Install dependencies
run: sudo apt-get update && sudo apt install -y $(./scripts/list-build-dependencies.sh --compiler-version 9)
- name: Build
run: ./scripts/build.sh --compiler-version 9 --lto
- name: "Summarize warnings"
run: ./scripts/count-warnings.py build.log
build_ubuntu_gcc_defaults:
name: "GCC"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-16.04]
steps:
- uses: actions/checkout@v1
- name: "Log environment"
run: ./scripts/log-env.sh
- name: Install dependencies
run: sudo apt-get update && sudo apt install -y $(./scripts/list-build-dependencies.sh)
- name: Build
run: ./scripts/build.sh
- name: "Summarize warnings"
run: ./scripts/count-warnings.py build.log
build_ubuntu_clang_8:
name: "Clang 8 (ubuntu-18.04)"
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: "Log environment"
run: ./scripts/log-env.sh
- name: Install dependencies
run: sudo apt-get update && sudo apt install -y $(./scripts/list-build-dependencies.sh --compiler clang --compiler-version 8)
- name: Build
run: ./scripts/build.sh --compiler clang --compiler-version 8 --lto
- name: "Summarize warnings"
run: ./scripts/count-warnings.py build.log

16
.github/workflows/macos.yml vendored Normal file
View file

@ -0,0 +1,16 @@
name: "macOS builds"
on: push
jobs:
build_macos_clang:
name: "Clang (macOS-10.14)"
runs-on: macOS-10.14
steps:
- uses: actions/checkout@v1
- name: "Log environment"
run: ./scripts/log-env.sh
- name: Install dependencies
run: brew install $(./scripts/list-build-dependencies.sh --compiler clang)
- name: Build
run: ./scripts/build.sh --compiler clang --lto
- name: "Summarize warnings"
run: python3 ./scripts/count-warnings.py build.log

142
.github/workflows/windows.yml vendored Normal file
View file

@ -0,0 +1,142 @@
# SPDX-License-Identifier: GPL-2.0-or-later
name: "Windows builds"
on: push
jobs:
build_msvc_debug:
name: "MSVC 14 Debug (win-2019)"
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
- name: "Log environment"
shell: pwsh
run: .\scripts\log-env.ps1
- name: "Install packages"
shell: pwsh
run: |
vcpkg install libpng sdl1 sdl1-net
vcpkg integrate install
- name: "Build"
shell: pwsh
env:
PATH: '${env:PATH};C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64'
run: |
# build steps
cd visualc_net
MSBuild -m dosbox.sln -p:Configuration=Debug
build_msvc_release:
name: "MSVC 14 Release (win-2019)"
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
- name: "Log environment"
shell: pwsh
run: .\scripts\log-env.ps1
- name: "Install packages"
shell: pwsh
run: |
vcpkg install libpng sdl1 sdl1-net
vcpkg integrate install
- name: "Build"
shell: pwsh
env:
PATH: '${env:PATH};C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64'
run: |
# build steps
cd visualc_net
MSBuild -m dosbox.sln -p:Configuration=Release
build_msys2_gcc_64:
name: MSYS2 GCC-9 x86_64
runs-on: windows-2019
env:
CHERE_INVOKING: yes
steps:
- uses: actions/checkout@v1
- name: Install msys2 environment
run: choco install msys2 --no-progress
- name: "Log environment"
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/log-env.sh"
- name: Install dependencies
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/list-build-dependencies.sh | xargs pacman -S --noconfirm"
- name: Build
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/build.sh --bin-path /mingw64/bin"
- name: Summarize warnings
run: .\scripts\count-warnings.py build.log
build_msys2_gcc_32:
name: MSYS2 GCC-9 i686
runs-on: windows-2019
env:
CHERE_INVOKING: yes
steps:
- uses: actions/checkout@v1
- name: Install msys2 environment
run: choco install msys2 --no-progress
- name: "Log environment"
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/log-env.sh"
- name: Install dependencies
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/list-build-dependencies.sh --bit-depth 32 | xargs pacman -S --noconfirm"
- name: Build
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/build.sh --bit-depth 32 --bin-path /mingw32/bin"
- name: Summarize warnings
run: .\scripts\count-warnings.py build.log
build_msys2_clang_64:
name: MSYS2 Clang-8 x86_64
runs-on: windows-2019
env:
CHERE_INVOKING: yes
steps:
- uses: actions/checkout@v1
- name: Install msys2 environment
run: choco install msys2 --no-progress
- name: "Log environment"
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/log-env.sh"
- name: Install dependencies
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/list-build-dependencies.sh --compiler clang | xargs pacman -S --noconfirm"
- name: Build
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/build.sh --compiler clang --bin-path /mingw64/bin"
- name: Summarize warnings
run: .\scripts\count-warnings.py build.log
build_msys2_clang_32:
name: MSYS2 Clang-8 i686
runs-on: windows-2019
env:
CHERE_INVOKING: yes
steps:
- uses: actions/checkout@v1
- name: Install msys2 environment
run: choco install msys2 --no-progress
- name: "Log environment"
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/log-env.sh"
- name: Install dependencies
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/list-build-dependencies.sh --compiler clang --bit-depth 32 | xargs pacman -S --noconfirm"
- name: Build
run: C:\tools\msys64\usr\bin\bash -lc "./scripts/build.sh --compiler clang --bit-depth 32 --bin-path /mingw32/bin"
- name: Summarize warnings
run: .\scripts\count-warnings.py build.log