Skip to content

makes the usb test more conditional so the build will pass on CI #20

makes the usb test more conditional so the build will pass on CI

makes the usb test more conditional so the build will pass on CI #20

# Copyright (c) 2021-2022-2023-2024 Luca Cappa
# Released under the term specified in file LICENSE.txt
# SPDX short identifier: MIT
#
# The peculiarity of this workflow is that assumes vcpkg stored as a submodule of this repository.
# The workflow runs on x64 and ARM platforms.
# Workflow steps:
# - Setup vcpkg and cache it on the GitHub Action cloud based cache.
# - Runs CMake with CMakePreset.json using a presest configuration
# that leverages the vcpkg's toolchain file. This will automatically run vcpkg
# to install dependencies described by the vcpkg.json manifest file.
# This stage also runs vcpkg with Binary Caching leveraging GitHub Action cache to
# store the built packages artifacts, hence it will be a no-op if those are restored
# from cache (e.g., already previously built).
# - Finally builds the sources with Ninja, and tests as well.
name: hosted-ninja-vcpkg_submod-autocache
on:
push:
pull_request:
branches:
- 'v*'
- main
- test-pipeline
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
build:
name: ${{ matrix.os }}-${{ github.workflow }}
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: false
matrix:
os: [windows-latest]
# os: [ubuntu-latest, macos-latest, windows-latest]
#env:
#
# [OPTIONAL] Define the vcpkg's triplet
# you want to enforce, otherwise the default one
# for the hosting system will be automatically
# choosen (x64 is the default on all platforms,
# e.g. x64-osx).
# VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: lukka/get-cmake@latest
- name: Restore from cache and setup vcpkg executable and data files.
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: 'vcpkg.json'
- name: Run CMake+vcpkg+Ninja+CTest to build packages and generate/build/test the code.
uses: lukka/run-cmake@v10
with:
configurePreset: 'release-config'
buildPreset: 'release-build'
testPreset: 'test-release'
# - name: Upload artifact
# if: startsWith(github.ref, 'refs/tags/')
# uses: actions/upload-artifact@v4
# with:
# name: build-artifacts
# path: |
# builds/release-config/Release/*.exe
# builds/release-config/Release/*.dll
# publish-build:
# name: "Publish Build"
# needs: ["build"]
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/')
# steps:
# - name: Download artifact from build
# uses: actions/download-artifact@v4
- run: ls builds/release-config/Release/
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
builds/release-config/Release/*.exe
builds/release-config/Release/*.dll