forked from TanninOne/usvfs
-
Notifications
You must be signed in to change notification settings - Fork 26
124 lines (115 loc) · 3.61 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
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 }}
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
# build
- run: cmake --build build_${{ matrix.arch }} --config ${{ matrix.config }}
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
- if: matrix.config == 'Debug'
uses: actions/upload-artifact@master
with:
name: usvfs-libs_${{ matrix.arch }}
path: ./lib
- if: matrix.config == 'Debug'
uses: actions/upload-artifact@master
with:
name: usvfs-bins_${{ matrix.arch }}
path: ./bin
- if: matrix.config == 'Debug'
uses: actions/upload-artifact@master
with:
name: usvfs-tests_${{ matrix.arch }}
path: ./test/bin
# merge x86 / x64 artifacts
merge-artifacts:
runs-on: ubuntu-latest
name: Merge Artifacts for Tests
needs: build
steps:
- name: Merge USVFS libs
uses: actions/upload-artifact/merge@v4
with:
name: usvfs-libs
pattern: usvfs-libs_*
- name: Merge USVFS bins
uses: actions/upload-artifact/merge@v4
with:
name: usvfs-bins
pattern: usvfs-bins_*
- name: Merge USVFS tests
uses: actions/upload-artifact/merge@v4
with:
name: usvfs-tests
pattern: usvfs-tests_*
test:
name: Test USVFS
needs: merge-artifacts
runs-on: windows-2022
strategy:
matrix:
arch: [x86, x64]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@master
with:
name: usvfs-libs
path: ./lib
- uses: actions/download-artifact@master
with:
name: usvfs-bins
path: ./bin
- uses: actions/download-artifact@master
with:
name: usvfs-tests
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.arch }}
path: ./test/temp
if-no-files-found: ignore
retention-days: 7
overwrite: true