-
-
Notifications
You must be signed in to change notification settings - Fork 77
143 lines (130 loc) · 5.49 KB
/
pr-ubuntu-docker.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
name: PR Ubuntu Docker
on:
pull_request:
# any
push:
branches:
- main
env:
BUILD_TYPE: RelWithDebInfo
jobs:
pr-ubuntu-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Get image to build upon
run: |
cat ${{github.workspace}}/misc/github_env_linux >> "$GITHUB_ENV"
- name: Store SP types from commit
run: |
commit=$(< ${{github.workspace}}/skyrim-platform/src/platform_se/codegen/convert-files/skyrimPlatform.ts)
chmod 777 ${{github.workspace}}/skyrim-platform/src/platform_se/codegen/convert-files
echo "$commit" > ${{github.workspace}}/skyrim-platform/src/platform_se/codegen/convert-files/temp.txt
# Download Skyrim SE data files
- uses: suisei-cn/actions-download-file@v1
name: Download Skyrim.esm
with:
url: "https://gitlab.com/pospelov/se-data/-/raw/main/Skyrim.esm"
target: ${{github.workspace}}/skyrim_data_files/
- uses: suisei-cn/actions-download-file@v1
name: Download Update.esm
with:
url: "https://gitlab.com/pospelov/se-data/-/raw/main/Update.esm"
target: ${{github.workspace}}/skyrim_data_files/
- uses: suisei-cn/actions-download-file@v1
name: Download Dawnguard.esm
with:
url: "https://gitlab.com/pospelov/se-data/-/raw/main/Dawnguard.esm"
target: ${{github.workspace}}/skyrim_data_files/
- uses: suisei-cn/actions-download-file@v1
name: Download HearthFires.esm
with:
url: "https://gitlab.com/pospelov/se-data/-/raw/main/HearthFires.esm"
target: ${{github.workspace}}/skyrim_data_files/
- uses: suisei-cn/actions-download-file@v1
name: Download Dragonborn.esm
with:
url: "https://gitlab.com/pospelov/se-data/-/raw/main/Dragonborn.esm"
target: ${{github.workspace}}/skyrim_data_files/
- name: Prepare
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
options: |
-v ${{github.workspace}}:/src
-v ${{github.workspace}}/.cmake-js:/home/skymp/.cmake-js
run: |
chown -R skymp:skymp /src /home/skymp/.cmake-js
- name: CMake Configure
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
options: |
-v ${{github.workspace}}:/src
-v ${{github.workspace}}/.cmake-js:/home/skymp/.cmake-js
-u skymp
run: |
cd /src \
&& ./build.sh --configure \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DUNIT_DATA_DIR="/src/skyrim_data_files"
- name: Upload compile_commands.json
uses: actions/upload-artifact@v3
with:
name: compile_commands.json
path: ${{github.workspace}}/build/compile_commands.json
- name: Build
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
options: |
-v ${{github.workspace}}:/src
-v ${{github.workspace}}/.cmake-js:/home/skymp/.cmake-js
-u skymp
run: |
cd /src \
&& ./build.sh --build
- name: Prepare dist.tar.gz
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
options: |
-v ${{github.workspace}}:/src
-v ${{github.workspace}}/.cmake-js:/home/skymp/.cmake-js
-u skymp
run: |
cd /src/build \
&& tar czf dist.tar.gz dist
- name: Upload dist.tar.gz
uses: actions/upload-artifact@v3
with:
name: dist.tar.gz
path: ${{github.workspace}}/build/dist.tar.gz
- name: SP Types Check
run: |
commit=$(< ${{github.workspace}}/skyrim-platform/src/platform_se/codegen/convert-files/temp.txt)
build=$(< ${{github.workspace}}/build/dist/client/Data/Platform/Modules/skyrimPlatform.ts)
difference=$(diff -u <(echo "$commit") <(echo "$build"))
size=$(echo -n $difference | wc -m)
echo "Size $size"
if [ $size != 0 ] ; then
echo "SP Types in codegen and build dist not equal"
echo "Difference:"
echo $difference
exit 1
fi
echo "SP Types in codegen and build dist equal"
- name: Test
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
options: |
-v ${{github.workspace}}:/src
-v ${{github.workspace}}/.cmake-js:/home/skymp/.cmake-js
-u skymp
run: |
cd /src/build \
&& ctest -C ${{env.BUILD_TYPE}} --verbose --output-on-failure