build-N-test-v2.1-Release #88
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
# | |
# Docs on github action files: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
# | |
# build-N-test-v2.1-Dev and build-N-test-v2.1-Release are nearly | |
# identical, but a few tests are commented out (to not needlessly stress CI system) | |
# for v2.1-Dev builds | |
# | |
# NOTE: I've tried many tricks - none which seem to work - to get this working on one file with one | |
# workflow and tests | |
# https://github.community/t/what-is-the-correct-if-condition-syntax-for-checking-matrix-os-version/16221 | |
# https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853 | |
# | |
# but none seem to work | |
# | |
name: build-N-test-v2.1-Release | |
on: | |
push: | |
branches: | |
#- v2.1-Dev | |
- v2.1-Release | |
workflow_dispatch: | |
inputs: | |
ignored: | |
description: "ignored" | |
required: false | |
default: "" | |
## NB: JOBS section IDENTICAL between v2.1-Dev and 2.1-Release files EXCEPT that on v2.1-Dev file | |
## comment out all entries marked with includeInDevBranchBuilds: false | |
jobs: | |
build-n-test-Linux: | |
runs-on: ${{ matrix.runs_on }} | |
strategy: | |
# | |
# Configuration notes | |
# o --debug-symbols false to reduce build disk size (and we aren't debugging anyhow) in many debug configurations | |
# | |
matrix: | |
include: | |
# ## SADLY: Container operations are only supported on Linux runners | |
# - displayTargetName: windows-DBG | |
# os: windows | |
# compiler: g++-8 | |
# runs_on: windows-2022 | |
# container_image: sophistsolutionsinc/stroika-buildvm-windows-cygwin-vs2k22:v2.1 | |
# cpp_version: c++17 | |
# config_name: Debug | |
# extra_config_args: --apply-default-debug-flags --trace2file enable | |
## ubuntu 18.04 | |
- displayTargetName: ubuntu-18.04-g++-8 (Debug) | |
os: unix | |
compiler: g++-8 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu1804-regression-tests:v2.1 | |
cpp_version: c++17 | |
config_name: Debug | |
extra_config_args: --apply-default-debug-flags --trace2file enable --debug-symbols false | |
includeInDevBranchBuilds: true | |
- displayTargetName: ubuntu-18.04-cross-compile-raspberrypi (Debug) | |
os: unix | |
compiler: g++-8 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu1804-regression-tests:v2.1 | |
cpp_version: c++17 | |
config_name: Debug | |
extra_config_args: --apply-default-release-flags --trace2file enable --compiler-driver arm-linux-gnueabihf-g++-8 --cross-compiling true | |
includeInDevBranchBuilds: true | |
# ubuntu 20.04 | |
- displayTargetName: ubuntu-20.04-g++-9 (Debug) | |
os: unix | |
compiler: g++-9 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu2004-regression-tests:v2.1 | |
cpp_version: c++17 | |
config_name: Debug | |
extra_config_args: --apply-default-debug-flags --trace2file enable --debug-symbols false | |
includeInDevBranchBuilds: false | |
- displayTargetName: ubuntu-20.04-g++-10 (Debug) | |
os: unix | |
compiler: g++-10 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu2004-regression-tests:v2.1 | |
cpp_version: c++17 | |
config_name: Debug | |
extra_config_args: --apply-default-debug-flags --trace2file enable --debug-symbols false | |
includeInDevBranchBuilds: false | |
- displayTargetName: ubuntu-20.04-g++-10 | |
os: unix | |
compiler: g++-10 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu2004-regression-tests:v2.1 | |
cpp_version: c++17 | |
config_name: Release | |
extra_config_args: --apply-default-release-flags --trace2file enable | |
includeInDevBranchBuilds: true | |
- displayTargetName: ubuntu-20.04-g++-10-c++2a | |
os: unix | |
compiler: g++-10 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu2004-regression-tests:v2.1 | |
cpp_version: c++2a | |
config_name: Release | |
extra_config_args: --apply-default-release-flags --trace2file enable | |
includeInDevBranchBuilds: false | |
- displayTargetName: ubuntu-20.04-clang++-10 | |
os: unix | |
compiler: clang++-10 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu2004-regression-tests:v2.1 | |
cpp_version: c++17 | |
config_name: Release | |
extra_config_args: --apply-default-release-flags --trace2file enable | |
includeInDevBranchBuilds: false | |
# ubuntu 22.04 | |
- displayTargetName: ubuntu-22.04-g++-11 (Debug) | |
os: unix | |
compiler: g++-11 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu2204-regression-tests:v2.1 | |
cpp_version: c++17 | |
config_name: Debug | |
extra_config_args: --apply-default-debug-flags --trace2file enable --debug-symbols false | |
includeInDevBranchBuilds: false | |
- displayTargetName: ubuntu-22.04-g++-12 (Debug) | |
os: unix | |
compiler: g++-12 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu2204-regression-tests:v2.1 | |
cpp_version: c++17 | |
config_name: Debug | |
extra_config_args: --apply-default-debug-flags --trace2file enable --debug-symbols false | |
includeInDevBranchBuilds: false | |
- displayTargetName: ubuntu-22.04-g++-12 | |
os: unix | |
compiler: g++-12 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu2204-regression-tests:v2.1 | |
cpp_version: c++17 | |
config_name: Release | |
extra_config_args: --apply-default-release-flags --trace2file enable | |
includeInDevBranchBuilds: true | |
- displayTargetName: ubuntu-22.04-g++-12-c++2a | |
os: unix | |
compiler: g++-12 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu2204-regression-tests:v2.1 | |
cpp_version: c++2a | |
config_name: Release | |
extra_config_args: --apply-default-release-flags --trace2file enable | |
includeInDevBranchBuilds: false | |
- displayTargetName: ubuntu-22.04-clang++-14 | |
os: unix | |
compiler: clang++-14 | |
runs_on: ubuntu-latest | |
container_image: sophistsolutionsinc/stroika-buildvm-ubuntu2204-regression-tests:v2.1 | |
cpp_version: c++17 | |
config_name: Release | |
extra_config_args: --apply-default-release-flags --trace2file enable | |
includeInDevBranchBuilds: false | |
### ATTEMPT TO COMPRESS 2 workflow files into one, but so far not working | |
### SEE | |
### https://stackoverflow.com/questions/65384420/how-to-make-a-github-action-matrix-element-conditional/65385385#65385385 | |
### | |
#if: github.ref == 'refs/heads/v2.1-Release' || matrix.includeInDevBranchBuilds | |
env: | |
# vm has 2 virtual CPUs, but 8GB ram, so jobs=3 (empirical), and QUICK_BUILD avoids some internal testing | |
MAKEFLAGS: "--jobs=3 QUICK_BUILD=1" | |
container: ${{ matrix.container_image }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build System Info | |
if: ${{ matrix.os=='unix' }} | |
run: | | |
lsb_release -d 2>/dev/null || true | |
echo "CWD=" `pwd` | |
echo "nproc=" `nproc` | |
grep "model name" /proc/cpuinfo | head -1 | |
grep processor /proc/cpuinfo | wc -l | |
grep MemTotal /proc/meminfo | |
df -h | |
- name: Build System Info (Windows) | |
if: ${{ matrix.os=='windows' }} | |
run: | | |
echo "CWD=" `pwd` | |
df -h | |
- name: Configure ${{ matrix.config_name }} | |
run: | | |
./configure ${{ matrix.config_name }} --compiler-driver ${{ matrix.compiler }} ${{ matrix.extra_config_args }} --cppstd-version ${{ matrix.cpp_version }} | |
cat ConfigurationFiles/${{ matrix.config_name }}.xml | |
# Break out third-party-components to do clean so we dont run out of disk space, and break out TPC AND library | |
# to show the summary time for each part | |
- name: Make third-party-components | |
run: | | |
make third-party-components | |
make clean | |
- name: Make libraries | |
run: make libraries | |
- name: Make Documentation | |
run: make documentation | |
# DISABLED DUE TO SPACE ISSUES | |
# - name: Make all | |
# run: make all | |
- name: Run Tests | |
run: | | |
make run-tests | |
- name: Save space | |
run: | | |
make --directory Tests clobber | |
- name: Make tools & samples | |
run: | | |
make tools samples | |
- name: Archive Samples Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Sample apps (${{ matrix.displayTargetName }}) | |
path: | | |
Builds/${{ matrix.config_name }}/Samples-* | |
- name: Archive Documentation Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Doxygen Documentation | |
path: | | |
Builds/Stroika-Doxygen-Help.tar.gz | |
- name: Archive Log Results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Log Data (${{ matrix.displayTargetName }}) | |
path: | | |
Builds/${{ matrix.config_name }}/PerformanceDump.txt | |
/tmp/Trace*.txt | |
build-n-test-MacOS: | |
runs-on: ${{ matrix.runs_on }} | |
strategy: | |
matrix: | |
# Add to extra_config_args for build speed: --Xerces no --OpenSSL no --lzma no --boost no | |
include: | |
- displayTargetName: MacOS-Debug | |
os: macos-latest | |
runs_on: macos-latest | |
config_name: Debug | |
extra_config_args: --apply-default-debug-flags --trace2file enable | |
includeInDevBranchBuilds: true | |
- displayTargetName: MacOS | |
os: macos-latest | |
runs_on: macos-latest | |
config_name: Release | |
extra_config_args: --apply-default-release-flags --trace2file enable | |
includeInDevBranchBuilds: false | |
env: | |
# vm has 2 virtual CPUs, but 8GB ram, so jobs=3 (empirical), and QUICK_BUILD avoids some internal testing | |
MAKEFLAGS: "--jobs=3 QUICK_BUILD=1" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build System Info | |
run: | | |
echo "CWD: `pwd`" | |
df -h | |
system_profiler SPSoftwareDataType | |
sw_vers | |
echo " X-CODE: `xcodebuild -version | tr '\n' ';'`" | |
# If we had docker ability, most of these would be built into a docker file | |
- name: Install Basic Build requirements | |
run: | | |
brew install gnu-sed | |
brew install p7zip | |
brew install automake | |
make install-realpath | |
- name: Configure | |
run: | | |
./configure ${{ matrix.config_name }} ${{ matrix.extra_config_args }} | |
cat ConfigurationFiles/${{ matrix.config_name }}.xml | |
- name: Build third-party-components | |
run: | | |
make third-party-components | |
make clean | |
- name: Build Library | |
run: | | |
make libraries | |
- name: Build All | |
run: | | |
make all | |
- name: Run-Tests | |
run: | | |
make run-tests | |
- name: Workaround GitHub-Actions-MacOS Issue with env.TMPDIR | |
run: | | |
mkdir /tmp/LOGS-ARCHIVE | |
cp $TMPDIR/Trace*.txt /tmp/LOGS-ARCHIVE | |
- name: DEBUG Workaround GitHub-Actions-MacOS Issue with env.TMPDIR | |
run: | | |
echo "TMPDIR=$TMPDIR" | |
echo "TMPDIR using ENV.TMPDIR=${{ env.TMPDIR }}" | |
# Just the echo line above shows empty, and then the ls line causes exit 1/failure | |
#ls -l ${{ env.TMPDIR }}/Trace*.txt | |
#if this gets fixed, then lose Workaround GitHub-Actions-MacOS, and directly reference ${{ env.TMPDIR }}/Trace*.txt in Archive Log Results | |
- name: Build System Info | |
run: | | |
df -h | |
- name: Archive Log Results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Log Results (${{ matrix.displayTargetName }}) | |
path: | | |
Builds/${{ matrix.config_name }}/PerformanceDump.txt | |
/tmp/LOGS-ARCHIVE | |
#${{ env.TMPDIR }}/Trace*.txt | |
- name: Archive Sample Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Samples (${{ matrix.displayTargetName }}) | |
path: | | |
Builds/${{ matrix.config_name }}/Samples-* | |
build-n-test-Windows: | |
runs-on: ${{ matrix.runs_on }} | |
strategy: | |
matrix: | |
# Add to extra_config_args for build speed: --Xerces no --OpenSSL no --lzma no --boost no | |
include: | |
- displayTargetName: windows-vs2k19-cygwin-x86-Debug | |
os: windows | |
runs_on: windows-2022 | |
container_image: sophistsolutionsinc/stroika-buildvm-windows-cygwin-vs2k19:v2.1 | |
config_name: Debug | |
extra_config_args: --arch x86 --apply-default-debug-flags --trace2file enable | |
includeInDevBranchBuilds: true | |
- displayTargetName: windows-vs2k22-cygwin-x86-Debug | |
os: windows | |
runs_on: windows-2022 | |
container_image: sophistsolutionsinc/stroika-buildvm-windows-cygwin-vs2k22:v2.1 | |
config_name: Debug | |
extra_config_args: --arch x86 --apply-default-debug-flags --trace2file enable | |
includeInDevBranchBuilds: true | |
- displayTargetName: windows-vs2k22-cygwin-x86-Release | |
os: windows | |
runs_on: windows-2022 | |
container_image: sophistsolutionsinc/stroika-buildvm-windows-cygwin-vs2k22:v2.1 | |
config_name: Release | |
extra_config_args: --arch x86 --apply-default-release-flags --trace2file enable | |
includeInDevBranchBuilds: false | |
- displayTargetName: windows-vs2k22-cygwin-x86_64-Release | |
os: windows | |
runs_on: windows-2022 | |
container_image: sophistsolutionsinc/stroika-buildvm-windows-cygwin-vs2k22:v2.1 | |
config_name: Release | |
extra_config_args: --arch x86_64 --apply-default-release-flags --trace2file enable | |
includeInDevBranchBuilds: false | |
- displayTargetName: windows-vs2k22-msys-x86-Debug | |
os: windows | |
runs_on: windows-2022 | |
container_image: sophistsolutionsinc/stroika-buildvm-windows-msys-vs2k22:v2.1 | |
config_name: Debug | |
extra_config_args: --arch x86 --apply-default-debug-flags --trace2file enable | |
includeInDevBranchBuilds: true | |
- displayTargetName: windows-vs2k22-msys-x86-Release | |
os: windows | |
runs_on: windows-2022 | |
container_image: sophistsolutionsinc/stroika-buildvm-windows-msys-vs2k22:v2.1 | |
config_name: Release | |
extra_config_args: --arch x86 --apply-default-release-flags --trace2file enable | |
includeInDevBranchBuilds: false | |
- displayTargetName: windows-vs2k22-msys-x86_64-Release | |
os: windows | |
runs_on: windows-2022 | |
container_image: sophistsolutionsinc/stroika-buildvm-windows-msys-vs2k22:v2.1 | |
config_name: Release | |
extra_config_args: --arch x86_64 --apply-default-release-flags --trace2file enable | |
includeInDevBranchBuilds: false | |
env: | |
# vm has 2 virtual CPUs, but 8GB ram, so jobs=3 (empirical), and QUICK_BUILD avoids some internal testing | |
MAKEFLAGS: "--jobs=3 QUICK_BUILD=1" | |
ARTIFACTS_DIR: "c:/Artifacts/" | |
steps: | |
- uses: actions/checkout@v3 | |
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=`echo ${GITHUB_REF#refs/heads/}`" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Build System Info | |
shell: "bash" | |
run: | | |
echo "CWD: `pwd`" | |
df -h | |
systeminfo | |
echo NUMBER_OF_PROCESSORS=$NUMBER_OF_PROCESSORS | |
- name: docker pull ${{ matrix.container_image }} | |
run: docker pull ${{ matrix.container_image }} | |
- name: Start docker build environment | |
### ash rebaseall nonsense to try and workaround sporadic failure on MSYS | |
### without this rebaseall, about 30% of the time we get a failure in wget wget 3470 child_info_fork::abort: \??\C:\msys64\usr\bin\msys-crypto-1.1.dll: Loaded to different address: parent(0x478B980000) != child(0x400000 | |
### and with this hack, it hasn't happened in 5 tries --LGP 2022-01-26 | |
run: | | |
docker run --interactive --memory 5G --cpus 2 --storage-opt 'size=50GB' --detach --name buildContainer ${{ matrix.container_image }} ash -c "c:/msys64/usr/bin/rebaseall -v; exec bash" | |
- name: Print Info about docker system | |
shell: "bash" | |
run: | | |
docker ps -a | |
docker exec buildContainer systeminfo | |
docker exec buildContainer df -h | |
- name: Git Checkout | |
shell: "bash" | |
run: | | |
docker exec --workdir c:/ buildContainer git clone https://github.com/SophistSolutions/Stroika.git --branch ${{ steps.extract_branch.outputs.branch }} | |
- name: Configure | |
shell: "bash" | |
run: | | |
docker exec --workdir c:/Stroika buildContainer sh -c "./configure ${{ matrix.config_name }} ${{ matrix.extra_config_args }}" | |
docker exec --workdir c:/Stroika buildContainer cat ConfigurationFiles/${{ matrix.config_name }}.xml | |
- name: Build | |
shell: "bash" | |
run: | | |
docker exec --workdir c:/Stroika --env MAKEFLAGS="$MAKEFLAGS" buildContainer make all | |
- name: Run-Tests | |
shell: "bash" | |
run: | | |
docker exec --workdir c:/Stroika --env MAKEFLAGS="$MAKEFLAGS" buildContainer make run-tests | |
- name: Build System Info | |
shell: "bash" | |
run: | | |
df -h | |
docker exec buildContainer df -h | |
- name: Copy Build Artifacts | |
shell: "bash" | |
# due to flaws in docker (windows must stop) - and cp no wildcards | |
run: | | |
docker exec --workdir c:/Stroika buildContainer sh -c 'mkdir TRACE_LOGS && cp $TEMP/Trace*.txt TRACE_LOGS/' | |
docker stop buildContainer | |
docker cp buildContainer:Stroika/Builds/${{ matrix.config_name }}/ $ARTIFACTS_DIR 2> /dev/null | |
docker cp buildContainer:Stroika/TRACE_LOGS $ARTIFACTS_DIR 2> /dev/null | |
rm -rf $ARTIFACTS_DIR/{ThirdPartyComponents,Tests,*.lib} | |
- name: Archive Log Results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Log Results (${{ matrix.displayTargetName }}) | |
path: | | |
${{ env.ARTIFACTS_DIR }}PerformanceDump.txt | |
${{ env.ARTIFACTS_DIR }}TRACE_LOGS | |
- name: Archive Sample Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Samples (${{ matrix.displayTargetName }}) | |
path: | | |
${{ env.ARTIFACTS_DIR }}Samples-* | |
codeql-analyze: | |
name: Analyze | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
language: [ 'cpp' ] | |
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] | |
# Learn more: | |
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed | |
env: | |
# QUICK_BUILD avoids some internal testing | |
MAKEFLAGS: "--jobs=3 QUICK_BUILD=1" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install tools required to build Stroika | |
run: | | |
sudo apt-get install -y libtool-bin pkg-config cmake automake autoconf libtool-bin libasan5 libubsan1 | |
sudo apt-get install -y g++-10 | |
- name: Configure | |
run: | | |
./configure Release --compiler-driver g++-10 --cppstd-version c++20 --apply-default-release-flags --lto disable | |
cat ConfigurationFiles/Release.xml | |
# Break out third-party-components to do clean so we dont run out of disk space, and break out TPC AND library | |
# to show the summary time for each part | |
- name: Make third-party-components | |
run: | | |
make third-party-components | |
make clean | |
# Initializes the CodeQL tools for scanning. | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: ${{ matrix.language }} | |
# If you wish to specify custom queries, you can do so here or in a config file. | |
# By default, queries listed here will override any specified in a config file. | |
# Prefix the list here with "+" to use these queries and those in the config file. | |
# queries: ./path/to/local/query, your-org/your-repo/queries@main | |
- name: Make Stroika | |
run: make all | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 |