C++ compatibility fixes. #267
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Compile C++ | |
# yamllint disable-line rule:truthy | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
push: | |
paths-ignore: | |
- '**.md' | |
jobs: | |
FileList: | |
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: | |
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 | |
if: always() | |
run: > | |
emcc -s WASM=1 -s ENVIRONMENT=node -s EXIT_RUNTIME=0 -s NO_EXIT_RUNTIME=1 -s ASSERTIONS=1 -Wall -s | |
MODULARIZE=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 --bind -s EXPORTED_FUNCTIONS="[]" -g -std=c++17 | |
"${{ matrix.file }}" | |
- name: Compile ${{ matrix.file }} via g++ | |
if: always() | |
run: g++ -g -std=c++17 -c "${{ matrix.file }}" |