Skip to content

Multiwinner: create new program testing other proportionality ideas. #86

Multiwinner: create new program testing other proportionality ideas.

Multiwinner: create new program testing other proportionality ideas. #86

Workflow file for this run

# Roughly based on
# https://github.com/flameshot-org/flameshot/blob/master/.github/workflows/build_cmake.yml
# https://github.com/cristianadam/HelloWorld/blob/master/.github/workflows/build_cmake.yml
# https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
# https://github.com/lukka/CppCMakeVcpkgTemplate/blob/v11/.github/workflows/hosted-pure-workflow.yml
# https://github.com/lukka/CppBuildTasks-Validation/blob/v10/.github/workflows/hosted-ninja-vcpkg.yml
name: CMake build of Quadelect
on: [push, pull_request]
env:
# Indicates the location of the vcpkg as a Git submodule of the project repository.
# Not using "VCPKG_ROOT" because a variable with the same name is defined in the VS's
# Developer Command Prompt environment in VS 2022 17.6, which would override this one
# if it had the same name.
_VCPKG_: ${{ github.workspace }}/vcpkg
# Tells vcpkg where binary packages are stored.
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg/bincache
# Let's use GitHub Action cache as storage for the vcpkg Binary Caching feature.
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
jobs:
# Maybe separate Windows and Linux instead of having a bunch of ifs?
# Consider the possibility, at least...
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest]
build_type: [Release]
# c++ is MinGW.
cpp_compiler: [g++, clang++, cl]
include:
- os: ubuntu-22.04
cpp_compiler: g++
- os: ubuntu-22.04
cpp_compiler: clang++
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
vckpgCommitId: '7f9f0e44db287e8e67c0e888141bfa200ab45121'
exclude:
- os: ubuntu-22.04
cpp_compiler: cl
- os: windows-latest
cpp_compiler: clang++
- os: windows-latest
# c_compiler keeps us from tripping if (MSVC) in
# CMakeLists.
# Currently disabled because it can't find libconfig++.
cpp_compiler: g++
#c_compiler: gcc
#vckpgCommitId: '7f9f0e44db287e8e67c0e888141bfa200ab45121'
name: ${{ matrix.os }}, ${{ matrix.cpp_compiler }}
steps:
# Windows caching steps from hosted-pure-workflow.yml
# Set env vars needed for vcpkg to leverage the GitHub Action cache as a storage
# for Binary Caching.
- name: Set cache URLs
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Checkout source code
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
submodules: true
- name: Checkout source code
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
- if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1.4.1
- name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
shell: bash
# Setup the build machine with the most recent versions of CMake and Ninja.
# Both are cached if not already: on subsequent runs both will be quickly
# restored from GitHub cache service.
- uses: lukka/get-cmake@latest
# Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
# when it is being run afterwards by CMake.
- name: Setup vcpkg (Windows)
if: matrix.os == 'windows-latest'
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
# This specifies the location of vcpkg, where it is going to be restored from cache, or create from scratch.
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# The Git commit id of vcpkg to be checked out. This is only needed because we are not using a submodule.
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId}}'
# The vcpkg.json file, which will be part of cache key computation.
vcpkgJsonGlob: '**/vcpkg.json'
- name: Prints output of run-vcpkg's action (Windows)
if: matrix.os == 'windows-latest'
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}'"
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get -y -qq update
sudo apt-get -y --no-install-recommends install \
cmake \
extra-cmake-modules \
build-essential \
libglpk-dev \
libconfig++-dev \
libeigen3-dev \
libboost-container-dev
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
# Not sure why this is needed??
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake (Linux)
if: matrix.os == 'ubuntu-22.04'
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }} --preset default
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }}