-
Notifications
You must be signed in to change notification settings - Fork 3
197 lines (159 loc) · 4.96 KB
/
ci.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: build + tests
on:
pull_request:
push:
workflow_dispatch:
jobs:
pre-job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
cancel_others: true
paths_ignore: >
[
".github/workflows/format.yml",
"**/README.md",
"**/CHANGELOG.md",
"**/LICENSE",
"**/.gitignore",
"**/.clang-format"
]
build-ubuntu:
strategy:
matrix:
arch: [x86_64]
mode: [debug, release]
needs: pre-job
if: ${{ needs.pre-job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
env:
CC: gcc-10
CXX: g++-10
steps:
- uses: actions/checkout@v2
# Force xmake to a specific folder (for cache)
- name: Set xmake env
run: >
echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >>
$GITHUB_ENV
# Install xmake
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
# Update xmake repository (in order to have the file that will be cached)
- name: Update xmake repository
run: xmake repo --update -v
# Fetch xmake dephash
- name: Retrieve dependencies hash
id: dep_hash
run: echo "::set-output name=hash::$(xmake l utils.ci.packageskey)"
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v2
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: >
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.mode }}-${{
steps.dep_hash.outputs.hash }}
# Configure
- name: Configure
run: xmake f -a ${{ matrix.arch }} -m ${{ matrix.mode }} -yv
# Build
- name: Build
run: xmake -v
# Run tests
- name: Test
run: xmake test
build-epitest:
strategy:
matrix:
arch: [x86_64]
mode: [debug, release]
needs: pre-job
if: ${{ needs.pre-job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
container: epitechcontent/epitest-docker
env:
XMAKE_ROOT: y
steps:
- uses: actions/checkout@v2
# Install bzip2
- name: Install dependencies
run: sudo dnf -y install bzip2
# Force xmake to a specific folder (for cache)
- name: Set xmake env
run: >
echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >>
$GITHUB_ENV
# Install xmake
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
# Update xmake repository (in order to have the file that will be cached)
- name: Update xmake repository
run: xmake repo --update -v
# Fetch xmake dephash
- name: Retrieve dependencies hash
id: dep_hash
run: echo "::set-output name=hash::$(xmake l utils.ci.packageskey)"
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v2
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: >
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.mode }}-${{
steps.dep_hash.outputs.hash }}
# Configure
- name: Configure
run: xmake f -a ${{ matrix.arch }} -m ${{ matrix.mode }} -yv
# Build
- name: Build
run: xmake -v
# Run tests
- name: Test
run: xmake test
build-windows:
needs: pre-job
if: ${{ needs.pre-job.outputs.should_skip != 'true' }}
runs-on: windows-latest
strategy:
matrix:
arch: [x64]
mode: [debug, release]
steps:
- uses: actions/checkout@v2
# Force xmake to a specific folder (for cache)
- name: Set xmake env
run: >
echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" | Out-File
-FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Install xmake
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
# Update xmake repository (in order to have the file that will be cached)
- name: Update xmake repository
run: xmake repo --update -v
# Fetch xmake dephash
- name: Retrieve dependencies hash
id: dep_hash
run: echo "::set-output name=hash::$(xmake l utils.ci.packageskey)"
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v2
with:
path: ${{ env.XMAKE_GLOBALDIR }}\.xmake\packages
key: >
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.mode }}-${{
steps.dep_hash.outputs.hash }}
# Configure
- name: Configure
run: xmake f -a ${{ matrix.arch }} -m ${{ matrix.mode }} -yv
# Build
- name: Build
run: xmake -v
# Run tests
- name: Test
run: xmake test