Skip to content

Add basic windows ci #110

Add basic windows ci

Add basic windows ci #110

Workflow file for this run

name: run all
on:
pull_request:
branches: [ main ]
workflow_dispatch:
push:
branches:
- main
jobs:
build-linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: update package index
run: sudo apt-get -y update
- name: setup environment
run: |
sudo apt-get install --no-install-recommends \
cmake \
g++ \
gcovr \
git \
libasio-dev \
libboost-test-dev \
libgl1-mesa-dev \
libtclap-dev \
ninja-build \
nlohmann-json3-dev \
qt6-base-dev \
ruby \
ruby-dev
- name: install ruby tools
run: |
sudo gem install bundler
sudo bundle install
- name: install gtest
run: |
git clone https://github.com/google/googletest.git
cd googletest
mkdir build
cd build
cmake ../
cmake --build . --parallel
sudo cmake --install .
- name: build and run
run: |
./run-linux.sh
- name: code coverage summary report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage/cobertura.xml
indicators: false
hide_complexity: true
format: markdown
output: file
- name: publish code coverage summary
run: |
echo '# Code Coverage Report' >> $GITHUB_STEP_SUMMARY
cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
build-windows:
# You can find specific tool versions for Windows builds in the Runner specification:
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
# In particular, this build uses:
# cmake: 3.27.9
# VSCode: 2022 Enterprise Edition (corresponding C++ version: https://blog.knatten.org/2022/08/26/microsoft-c-versions-explained/)
# Ruby: 3.0.6p216
# boost: 1.82.0
runs-on: windows-2022
env:
BOOST_VERSION: 1.82.0
NLOHMANN_CLONE_DIR: nlohmann
NLOHMANN_TAG: v3.11.3
ASIO_CLONE_DIR: asio
ASIO_TAG: asio-1-29-0
TCLAP_CLONE_DIR: tclap
TCLAP_TAG: v1.2.5
steps:
- uses: actions/checkout@v4
- name: install ruby tools
run: |
gem install bundler
bundle install
# - name: Install Google Test
# uses: MarkusJx/googletest-installer@v1.1
- name: Restore cached boost dependencies
id: cache-boost-deps
uses: actions/cache@v3
with:
path: |
boost_1_82_0
key: ${{ runner.os }}-boost-1820
- name: install boost
if: steps.cache-boost-deps.outputs.cache-hit != 'true'
run: |
$boost_version_str = ${Env:BOOST_VERSION}.Replace(".","_")
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://boostorg.jfrog.io/artifactory/main/release/${Env:BOOST_VERSION}/source/boost_${boost_version_str}.zip -OutFile boost_${boost_version_str}.zip
7z x boost_${boost_version_str}.zip
cd boost_${boost_version_str}
cmd /C bootstrap
./b2.exe --build-type=complete toolset=msvc --with-regex --with-program_options --with-system --with-test
- name: Get and build nlohmann-json
run: |
Start-Process "git" -ArgumentList "clone https://github.com/nlohmann/json.git $Env:NLOHMANN_CLONE_DIR --depth 1 --branch $Env:NLOHMANN_TAG" -PassThru -NoNewWindow -Wait
cd $Env:NLOHMANN_CLONE_DIR
cmake -B build -S .
cd ..
- name: Get ASIO
run: Start-Process "git" -ArgumentList "clone https://github.com/chriskohlhoff/asio.git $Env:ASIO_CLONE_DIR --depth 1 --branch $Env:ASIO_TAG" -PassThru -NoNewWindow -Wait
- name: Get TCLAP
run: Start-Process "git" -ArgumentList "clone https://github.com/mirror/tclap.git $Env:TCLAP_CLONE_DIR --depth 1 --branch $Env:TCLAP_TAG" -PassThru -NoNewWindow -Wait
- name: build and run
run: |
$current_script_dir = Get-Location | Select-Object -Expand "Path"
$Env:nlohmann_json_DIR = "${current_script_dir}/$Env:NLOHMANN_CLONE_DIR/build"
$Env:Asio_ROOT = "${current_script_dir}/$Env:ASIO_CLONE_DIR/asio"
$Env:TCLAP_ROOT = "${current_script_dir}/$Env:TCLAP_CLONE_DIR"
./run-windows.ps1