Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{ci} Add build of shared lib release builds #219

Merged
merged 1 commit into from
Jan 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
88 changes: 69 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,57 @@ jobs:
strategy:
fail-fast: false
matrix:
build_type: ['Debug', 'Release']
config:
- { name: '🍏 macOS Clang', os: macos-latest }
- { name: '🐧 Linux GCC', os: ubuntu-latest }
- { name: '🪟 Windows MSVC', os: windows-latest }

name: ${{ matrix.config.name }} (${{ matrix.build_type }})
runs-on: ${{ matrix.config.os }}
include:
- name: 🍏 macOS (Clang - Debug)
os: macos-latest
platform: macos
build_type: Debug
build_shared: OFF
- name: 🍏 macOS (Clang - Release)
os: macos-latest
platform: macos
build_type: Release
build_shared: OFF
- name: 🍏 macOS (Clang, Shared - Release)
os: macos-latest
platform: macos
build_type: Release
build_shared: ON

- name: 🐧 Linux (GCC - Debug)
os: ubuntu-latest
platform: linux
build_type: Debug
build_shared: OFF
- name: 🐧 Linux (GCC - Release)
os: ubuntu-latest
platform: linux
build_type: Release
build_shared: OFF
- name: 🐧 Linux (GCC, Shared - Release)
os: ubuntu-latest
platform: linux
build_type: Release
build_shared: ON

- name: 🪟 Windows (MSVC - Debug)
os: windows-latest
platform: windows
build_type: Debug
build_shared: OFF
- name: 🪟 Windows (MSVC - Release)
os: windows-latest
platform: windows
build_type: Release
build_shared: OFF
- name: 🪟 Windows (MSVC, Shared - Release)
os: windows-latest
platform: windows
build_type: Release
build_shared: ON

name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
Expand All @@ -29,25 +72,25 @@ jobs:
path: libE57Format-test-data

- name: Install Dependencies (macOS)
if: matrix.config.os == 'macos-latest'
if: matrix.platform == 'macos'
run: |
brew install ccache ninja xerces-c

- name: Install Dependencies (Linux)
if: matrix.config.os == 'ubuntu-latest'
if: matrix.platform == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y ccache libxerces-c-dev ninja-build
sudo locale-gen fr_FR

- name: Install Dependencies (Windows)
if: matrix.config.os == 'windows-latest'
if: matrix.platform == 'windows'
uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge

- name: Install More Dependencies (Windows)
if: matrix.config.os == 'windows-latest'
if: matrix.platform == 'windows'
shell: bash -el {0}
run: |
conda install xerces-c=3.2.4
Expand All @@ -59,18 +102,20 @@ jobs:
uses: hendrikmuhs/ccache-action@v1.2
with:
max-size: '5G'
key: ${{ matrix.config.os }}-${{ matrix.build_type }}
key: ${{ matrix.os }}-${{ matrix.build_type }}

- name: Configure MSVC console (Windows)
if: matrix.config.os == 'windows-latest'
if: matrix.platform == 'windows'
uses: ilammy/msvc-dev-cmd@v1

- name: Set environment for MSVC (Windows)
if: matrix.config.os == 'windows-latest'
- name: Output conda info (Windows)
if: matrix.platform == 'windows'
run: |
# Set these env vars so cmake picks the correct compiler
echo "CXX=cl.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CC=cl.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort

- name: Configure (Debug)
if: matrix.build_type == 'Debug'
Expand All @@ -81,6 +126,7 @@ jobs:
-B libE57Format-build
-G "Ninja"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DE57_BUILD_SHARED=${{ matrix.build_shared }}
-DE57_MAX_DEBUG=1
.

Expand All @@ -93,11 +139,15 @@ jobs:
-B libE57Format-build
-G "Ninja"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DE57_BUILD_SHARED=${{ matrix.build_shared }}
-DE57_DEBUG=0
.

- name: Build
run: cmake --build libE57Format-build

- name: Test
# I cannot get this to run on Windows with a shared lib.
# It's not giving an error so I have no idea what's happening.
if: ${{ !(matrix.platform == 'windows' && matrix.build_shared == 'ON') }}
run: libE57Format-build/test/testE57