Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 37 additions & 26 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: SlimeVR OpenVR Driver
name: Build and test OpenVR driver

on: [ push, pull_request, workflow_dispatch ]

jobs:
build:

name: Build for ${{ matrix.os }}
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -14,10 +13,12 @@ jobs:
include:
- os: windows-latest
triplet: x64-windows-static-md
name: win64
target: ALL_BUILD
release_dir: Release # dir of driver binaries within env.CMAKE_BUILD_DIR, VS multi-config uses <CONFIG>/ subfolder
- os: ubuntu-latest
triplet: x64-linux
name: x64-linux
target: all
release_dir: "" # makefile single config won't have subfolder
env:
Expand Down Expand Up @@ -68,32 +69,20 @@ jobs:
- name: Build
run: cmake --build "${{env.CMAKE_BUILD_DIR}}" --config Release --target "${{ matrix.target }}" -j 6 --

- name: Upload a build artifact
- name: Upload driver
uses: actions/upload-artifact@v7
with:
# Artifact name
name: slimevr-openvr-driver-${{ matrix.triplet }} # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
# Using wildcards so that only the driver directory gets included (if you specify it, then it won't be included)
path: |
${{env.CMAKE_BUILD_DIR}}/${{ matrix.release_dir }}/driver/*
${{env.CMAKE_BUILD_DIR}}/${{ matrix.release_dir }}/tests*
name: slimevr-openvr-driver-${{ matrix.name }}
path: ${{ env.CMAKE_BUILD_DIR }}/${{ matrix.release_dir }}/driver

- name: Zip
if: startsWith(github.ref, 'refs/tags/')
working-directory: ${{env.CMAKE_BUILD_DIR}}/${{ matrix.release_dir }}/driver
run: cmake -E tar "cf" "${{env.CMAKE_BUILD_DIR}}/slimevr-openvr-driver-${{ matrix.triplet }}.zip" --format=zip -- ${{env.CMAKE_BUILD_DIR}}/${{ matrix.release_dir }}/driver/slimevr

- name: Upload to draft release
uses: softprops/action-gh-release@v3
if: startsWith(github.ref, 'refs/tags/')
- name: Upload tests
uses: actions/upload-artifact@v7
with:
draft: true
generate_release_notes: true
files: "${{env.CMAKE_BUILD_DIR}}/slimevr-openvr-driver-${{ matrix.triplet }}.zip"
name: tests-${{ matrix.name }}
path: ${{ env.CMAKE_BUILD_DIR }}/${{ matrix.release_dir }}/tests*

test:
name: Run tests
name: Run tests (${{ matrix.os }})
needs: build
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -103,15 +92,17 @@ jobs:
include:
- os: windows-latest
triplet: x64-windows-static-md
target: RUN_TESTS
name: win64
target: ALL_BUILD
- os: ubuntu-latest
triplet: x64-linux
target: test
name: x64-linux
target: all
steps:
- name: Download build artifact
uses: actions/download-artifact@v8
with:
name: slimevr-openvr-driver-${{ matrix.triplet }}
name: tests-${{ matrix.name }}
path: ${{ github.workspace }}
- if: matrix.os == 'windows-latest'
name: Run tests on Windows
Expand All @@ -121,3 +112,23 @@ jobs:
name: Run tests on Unix
working-directory: ${{ github.workspace }}/
run: chmod +x ./tests && ./tests

upload-release:
name: Upload draft release
needs: [build, test]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download driver artifacts
uses: actions/download-artifact@v8
with:
path: ${{ github.workspace }}
pattern: slimevr-openvr-driver-*
merge-multiple: true
skip-decompress: true

- uses: softprops/action-gh-release@v3
with:
draft: true
generate_release_notes: true
files: slimevr-openvr-driver-*.zip
Loading