Update CI. #91
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build USVFS | |
on: | |
push: | |
branches: [master, dev/cmake] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
jobs: | |
build: | |
name: Build USVFS | |
strategy: | |
matrix: | |
arch: [x86, x64] | |
config: [Debug, Release] | |
runs-on: windows-2022 | |
steps: | |
# https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache | |
- name: Export GitHub Actions cache environment variables | |
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 || ''); | |
# checkout USVFS and vcpkg | |
- uses: actions/checkout@v4 | |
- uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgGitCommitId: f61a294e765b257926ae9e9d85f96468a0af74e7 | |
vcpkgJsonGlob: ${{ github.workspace }}/usvfs/vcpkg.json | |
# configure | |
- run: cmake --preset vs2022-windows-${{ matrix.arch }} -B build_${{ matrix.arch }} -DCMAKE_INSTALL_PREFIX=./install | |
env: | |
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
# build | |
- run: cmake --build build_${{ matrix.arch }} --config ${{ matrix.config }} --target INSTALL | |
env: | |
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
# package install | |
- uses: actions/upload-artifact@master | |
with: | |
name: usvfs_${{ matrix.config }}_${{ matrix.arch }} | |
path: ./install | |
# package test/dlls/etc. for tests | |
- uses: actions/upload-artifact@master | |
with: | |
name: usvfs-libs_${{ matrix.config }}_${{ matrix.arch }} | |
path: ./lib | |
- uses: actions/upload-artifact@master | |
with: | |
name: usvfs-bins_${{ matrix.config }}_${{ matrix.arch }} | |
path: ./bin | |
- uses: actions/upload-artifact@master | |
with: | |
name: usvfs-tests_${{ matrix.config }}_${{ matrix.arch }} | |
path: ./test/bin | |
# merge x86 / x64 artifacts | |
merge-artifacts: | |
runs-on: ubuntu-latest | |
name: Merge Artifacts | |
needs: build | |
strategy: | |
matrix: | |
config: [Debug, Release] | |
steps: | |
- name: Merge USVFS install | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
name: usvfs_${{ matrix.config }} | |
pattern: usvfs_${{ matrix.config }}_* | |
- name: Merge USVFS libs | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
name: usvfs-libs_${{ matrix.config }} | |
pattern: usvfs-libs_${{ matrix.config }}_* | |
- name: Merge USVFS bins | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
name: usvfs-bins_${{ matrix.config }} | |
pattern: usvfs-bins_${{ matrix.config }}_* | |
- name: Merge USVFS tests | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
name: usvfs-tests_${{ matrix.config }} | |
pattern: usvfs-tests_${{ matrix.config }}_* | |
test: | |
name: Test USVFS | |
needs: merge-artifacts | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
config: [Debug, Release] | |
arch: [x86, x64] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@master | |
with: | |
name: usvfs-libs_${{ matrix.config }} | |
path: ./lib | |
- uses: actions/download-artifact@master | |
with: | |
name: usvfs-bins_${{ matrix.config }} | |
path: ./bin | |
- uses: actions/download-artifact@master | |
with: | |
name: usvfs-tests_${{ matrix.config }} | |
path: ./test/bin | |
- run: ./test/bin/shared_test_${{ matrix.arch }}.exe | |
if: always() | |
- run: ./test/bin/testinject_bin_${{ matrix.arch }}.exe | |
if: always() | |
- run: ./test/bin/thooklib_test_${{ matrix.arch }}.exe | |
if: always() | |
- run: ./test/bin/tinjectlib_test_${{ matrix.arch }}.exe | |
if: always() | |
- run: ./test/bin/tvfs_test_${{ matrix.arch }}.exe | |
if: always() | |
- run: ./test/bin/usvfs_test_runner_${{ matrix.arch }}.exe | |
if: always() | |
- uses: actions/upload-artifact@master | |
if: always() | |
with: | |
name: tests-outputs_${{ matrix.config }}_${{ matrix.arch }} | |
path: ./test/temp | |
if-no-files-found: ignore | |
retention-days: 7 | |
overwrite: true |