Skip to content

Windows-2019

Windows-2019 #412

Workflow file for this run

name: Windows-2019
on:
push:
branches:
- main
tags:
- '*'
pull_request:
schedule:
- cron: '0 5 * * *'
# allow manually starting this workflow
workflow_dispatch:
env:
VCPKG_PKGS: >-
boost-dll boost-filesystem
jobs:
windows_ci:
name: Windows-2019
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
with:
path: workspace/src/plugin_loader
- name: checkout-vcpkg
uses: actions/checkout@v2
with:
path: vcpkg
repository: microsoft/vcpkg
- name: bootstrap-vcpkg
working-directory: vcpkg
run: bootstrap-vcpkg.bat
- name: vcpkg-dry-run
working-directory: vcpkg
shell: cmd
run: |
vcpkg install --dry-run --triplet x64-windows ${{ env.VCPKG_PKGS }} > vcpkg_dry_run.txt
- name: cache-vcpkg-archives
if: startsWith(github.ref, 'refs/tags/v') != true
id: cache-vcpkg-archives
uses: pat-s/always-upload-cache@v3
with:
path: C:\Users\runneradmin\AppData\Local\vcpkg\archives
key: ${{ runner.os }}-x64-vcpkg-${{ hashFiles('vcpkg/vcpkg_dry_run.txt') }}-main
- name: install-depends
shell: cmd
run: |
vcpkg integrate install
python -m pip install vcstool -q
python -m pip install colcon-common-extensions -q
python -m pip install ninja -q
vcpkg install --triplet x64-windows ${{ env.VCPKG_PKGS }}
- name: configure-msvc
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: build-workspace
working-directory: workspace
shell: cmd
run: |
vcs import --input "${{ github.workspace }}/workspace/src/plugin_loader/dependencies.repos" src/
colcon build --event-handlers console_direct+ --cmake-args -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DENABLE_CPACK=ON
if %ERRORLEVEL% GEQ 1 exit 1
- name: run-test
working-directory: workspace
shell: cmd
run: |
colcon test --event-handlers console_direct+ --return-code-on-test-failure
colcon test-result --verbose
- name: Package
if: ${{ github.event_name == 'release' && github.event.action == 'released' }}
working-directory: workspace/build/boost_plugin_loader
run: |
cpack --config CPackConfig.cmake
cp ./*.nupkg ${{ github.workspace }}/artifacts
cp ./*.tar.xz ${{ github.workspace }}/artifacts
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'release' && github.event.action == 'released' }}
with:
name: nuget_package
path: ${{ github.workspace }}/artifacts/*.nupkg
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'release' && github.event.action == 'released' }}
with:
name: archive_package
path: ${{ github.workspace }}/artifacts/*.tar.xz