-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (76 loc) · 2.74 KB
/
release.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
name: Release
env:
BUILD_TYPE: Release
jobs:
Build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
cmake-options: -DTRACER_STATIC=ON
target: Linux
- os: windows-latest
cmake-options: -DTRACER_STATIC=ON
target: Windows
- os: macos-latest
cmake-options: -DTRACER_STATIC=ON
target: macOS
steps:
- uses: actions/checkout@v3
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{matrix.cmake-options}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
- name: Compare Unix results with pre-recorded outputs
if: ${{ matrix.os != 'windows-latest' }}
working-directory: ${{github.workspace}}/build
run: |
./tracer ../cat-and-mouse.if ../cat-and-mouse-1.xtr > cat-and-mouse-1.txt
diff ../cat-and-mouse-1.txt cat-and-mouse-1.txt
./tracer ../cat-and-mouse.if ../cat-and-mouse-1.xtr > cat-and-mouse-cheese.txt
diff ../cat-and-mouse-cheese.txt cat-and-mouse-cheese.txt
- name: Compare Windows results with pre-recorded outputs
if: ${{ matrix.os == 'windows-latest' }}
working-directory: ${{github.workspace}}/build
run: |
${{env.BUILD_TYPE}}\tracer.exe ..\cat-and-mouse.if ..\cat-and-mouse-1.xtr > cat-and-mouse-1.txt
fc.exe /L ..\cat-and-mouse-1.txt cat-and-mouse-1.txt
${{env.BUILD_TYPE}}\tracer.exe ..\cat-and-mouse.if ..\cat-and-mouse-1.xtr > cat-and-mouse-cheese.txt
fc.exe /L ..\cat-and-mouse-cheese.txt cat-and-mouse-cheese.txt
- name: Upload Unix binaries
if: ${{ matrix.os != 'windows-latest' }}
uses: actions/upload-artifact@v3
with:
name: tracer-${{matrix.os}}
path: build/tracer
if-no-files-found: error
- name: Upload Windows binaries
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v3
with:
name: tracer-${{matrix.os}}
path: build/${{env.BUILD_TYPE}}/tracer.exe
if-no-files-found: error
Upload:
needs: [ Build ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get the release files
uses: action/download-artifact@v3
with:
path: .
- name: Display list of files
run: ls -R
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
tracer tracer.exe
tag_name: v1.0