sointu/.github/workflows/tests.yml
Veikko Sariola e4490faa2e feat(compiler): Add support for targeting WebAssembly.
The working principle is similar as before with x86, but instead of outputting .asm, it outputs .wat. This can be compiled into .wasm by using the wat2wasm assembler.
2020-12-26 23:16:18 +02:00

66 lines
2.1 KiB
YAML

# Run unit tests using CTest and go tests
name: Tests
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
jobs:
test:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- os: ubuntu-latest
asmnasm: /home/runner/nasm/nasm
cmakeflags: -GNinja
maker: ninja
gotests: yes
cgo_ldflags:
- os: windows-latest
cmakeflags: -GNinja
maker: ninja
asmnasm: C:\Users\runneradmin\nasm\nasm
gotests: yes
cgo_ldflags:
- os: macos-latest
cmakeflags: -GNinja
maker: ninja
asmnasm: /Users/runner/nasm/nasm
gotests: yes
cgo_ldflags: # -Wl,-no_pie
# ld on mac is complaining about position dependent code so this would take the errors away, BUT
# suddenly this causes an error, even though worked last week. Let's accept the warnings rather
# than let the tests fail because of this.
# TODO: win32 builds didn't quite work out, complains gcc broken
steps:
- uses: lukka/get-cmake@v3.18.3
- uses: actions/setup-go@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v2
- uses: ilammy/setup-nasm@v1.2.0
- name: Install libasound2-dev # sointu-cli has alsa as dependency for playing sound and
if: ${{ matrix.config.os == 'ubuntu-latest' }} # ubuntu was complaining about "Package alsa was not found in the pkg-config search path.",
run: sudo apt install libasound2-dev # leading to tests failing. This fixes that.
- name: Run ctest
env:
ASM_NASM: ${{ matrix.config.asmnasm }}
run: |
mkdir build
cd build
cmake ${{ matrix.config.cmakeflags }} ..
${{ matrix.config.maker }}
ctest --output-on-failure
- name: Run go test
if: ${{ matrix.config.gotests == 'yes' }}
env:
CGO_LDFLAGS: ${{ matrix.config.cgo_ldflags }}
run: |
go test . ./bridge