feat(CI&go4k): Run go tests in cloud, skipping sample tests if on another platform than Windows.

This commit is contained in:
Veikko Sariola 2020-11-12 13:29:30 +02:00
parent a799ee2b6d
commit c39f434c6b
2 changed files with 18 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# Run unit tests using CTest
# Run unit tests using CTest and go tests
name: Tests
on:
@ -12,15 +12,16 @@ on:
- dev
jobs:
test:
test:
runs-on: ubuntu-latest
steps:
- name: get-cmake
uses: lukka/get-cmake@v3.18.3
- uses: lukka/get-cmake@v3.18.3
- uses: actions/setup-go@v2
- uses: actions/checkout@v2
- uses: ilammy/setup-nasm@v1.1.0
- run: /home/runner/nasm/nasm -version
- env:
- name: Running ctests
env:
ASM_NASM: /home/runner/nasm/nasm
run: |
mkdir build
@ -28,3 +29,7 @@ jobs:
cmake -GNinja ..
ninja
ctest --output-on-failure
- name: Running go tests
run: |
cd go4k
go test . ./bridge

View File

@ -28,6 +28,10 @@ func TestAllAsmFiles(t *testing.T) {
basename := filepath.Base(filename)
testname := strings.TrimSuffix(basename, path.Ext(basename))
t.Run(testname, func(t *testing.T) {
if runtime.GOOS != "windows" && strings.Contains(testname, "sample") {
t.Skip("Samples (gm.dls) available only on Windows")
return
}
asmcode, err := ioutil.ReadFile(filename)
if err != nil {
t.Fatalf("cannot read the .asm file: %v", filename)
@ -81,6 +85,10 @@ func TestSerializingAllAsmFiles(t *testing.T) {
basename := filepath.Base(filename)
testname := strings.TrimSuffix(basename, path.Ext(basename))
t.Run(testname, func(t *testing.T) {
if runtime.GOOS != "windows" && strings.Contains(testname, "sample") {
t.Skip("Samples (gm.dls) available only on Windows")
return
}
asmcode, err := ioutil.ReadFile(filename)
if err != nil {
t.Fatalf("cannot read the .asm file: %v", filename)