-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (151 loc) · 5.87 KB
/
ci-builds.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: ParticlesFullTestsAndRelease
on:
push:
branches: [ "main" ]
tags: 'v*'
paths-ignore:
- 'doc/**'
- '.github/**'
pull_request:
workflow_dispatch:
jobs:
linuxXlinux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential xorg-dev mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev libxinerama-dev libxcursor-dev xvfb x11-apps vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
- name: linux-linux
run: |
./build.sh -t -r -e
mkdir linux-x86_64
cp -r build/Examples linux-x86_64-examples
chmod +x linux-x86_64-examples/Particles/Particles
cp build/libjGL.a linux-x86_64/libjGL-linux-x86_64.a
cp LICENSE linux-x86_64-examples/
cp LICENSE linux-x86_64/
- name: Tests
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ctest --exclude-regex Vulkan --extra-verbose --output-on-failure
- name: buildArtifact
uses: actions/upload-artifact@v3
with:
name: linux-x86_64
path: linux-x86_64
- name: buildArtifact
uses: actions/upload-artifact@v3
with:
name: linux-x86_64-examples
path: linux-x86_64-examples
linuxXwindows:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xorg-dev build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix libxinerama-dev libxcursor-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
- name: linux-X-windows
run: |
./build.sh -t -w -r -e
mkdir windows
cp -r build/Examples windows-examples
chmod +x windows-examples/Particles/Particles.exe
cp build/libjGL.a windows/libjGL-windows.a
cp LICENSE windows-examples/
cp LICENSE windows/
- name: buildArtifact
uses: actions/upload-artifact@v3
with:
name: windows
path: windows
- name: buildArtifact
uses: actions/upload-artifact@v3
with:
name: windows-examples
path: windows-examples
linuxRun:
needs: linuxXlinux
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xvfb x11-apps imagemagick
- name: get linux build
uses: actions/download-artifact@v3
with:
name: linux-x86_64-examples
- name: launch and screenshot
run: |
ls
cd Particles
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ./Particles &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot.png
sleep 5 && kill $PID
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: screenshot
path: Particles/screenshot.png
release:
needs: [linuxXlinux, linuxXwindows]
if: github.ref_type == 'tag'
runs-on: ubuntu-22.04
steps:
- name: get linux build
uses: actions/download-artifact@v3
with:
name: linux-x86_64
- name: get windows build
uses: actions/download-artifact@v3
with:
name: windows
# https://github.com/softprops/action-gh-release
- name: release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: true
name: "release-${{ github.ref_name }}"
tag_name: ${{ github.ref }}
files: |
libjGL-linux-x86_64.a
libjGL-windows.a
# - name: create release
# id: createRelease
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# draft: true
# prerelease: false
# release_name: "release-${{ github.ref_name }}"
# tag_name: ${{ github.ref }}
# - name: upload linux release artifact
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.createRelease.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: Particles-linux-x86_64
# asset_name: linux
# asset_content_type: application/zip
# retention-days: 30
# - name: upload windows release artifact
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.createRelease.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: Particles.exe
# asset_name: windows
# asset_content_type: application/zip
# retention-days: 30