-
-
Notifications
You must be signed in to change notification settings - Fork 100
53 lines (49 loc) · 1.34 KB
/
compile-cpp.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
---
name: Compile C++
# yamllint disable-line rule:truthy
on:
pull_request:
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'
jobs:
FileList:
if: ${{ false }} # @fixme
outputs:
filelist: ${{ steps.get-files.outputs.filelist }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set output with list of files
id: get-files
run: |
import glob, json, os
files = glob.glob("**/tests/*.cpp")
print("::set-output name=filelist::{}".format(json.dumps(files)))
shell: python
- name: Display output
run: echo ${{ steps.get-files.outputs.filelist }}
Compile:
if: ${{ false }} # @fixme
runs-on: ubuntu-latest
needs: [FileList]
strategy:
matrix:
file: ${{ fromJson(needs.FileList.outputs.filelist) }}
steps:
- uses: actions/checkout@v2
- name: Install Emscripten toolchain
uses: mymindstorm/setup-emsdk@v11
- name: Install CPP compiler
uses: rlalik/[email protected]
with:
compiler: gcc-latest
- name: Compile ${{ matrix.file }} via emcc
run: emcc "${{ matrix.file }}"
- name: Compile ${{ matrix.file }} via g++
run: g++ -c "${{ matrix.file }}"
- if: failure()
# Force success.
run: exit 0