Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve: "add CI tests" #16

Merged
merged 13 commits into from
Jun 26, 2022
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: ci

on:
pull_request:
push:
branches:
- master

defaults:
run:
shell: bash

jobs:

# check consistency between Groovy and C++ APIs
groovy-vs-cpp:
runs-on: [ ubuntu-latest ]
strategy:
fail-fast: false
matrix:
dataset: [ rga_inbending, rga_outbending, rga_spring19, rgb_fall, rgb_spring, rgb_winter, rgk_6, rgk_7 ]
steps:
- name: checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: setup-groovy
run: |
sudo apt install groovy
- name: env
run: |
source env.sh
echo "QADB=${QADB}" >> $GITHUB_ENV
echo "JYPATH=${JYPATH}" >> $GITHUB_ENV
- name: compile-cpp-tests
run: |
cd srcC/tests
make
- name: test-diff-groovy-cpp
run: |
tests/test_diffGroovyCpp.loop.sh ${{matrix.dataset}}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ Documentation for QADB maintenance and revision
version; repeat the same procedure for
`bin/printGoldenFiles.sh > text/listOfGoldFiles.txt`
* update customized QA criteria sets, such as `OkForAsymmetry`
* add any new dataset to the CI tests: `.github/workflows/ci.yml`
* use `git status` and `git diff` to review changes, then add and commit to
git, and push to the remote branch

Expand Down
6 changes: 5 additions & 1 deletion env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash

export QADB=$(dirname $(realpath $0))
if [ -z "${BASH_SOURCE[0]}" ]; then
export QADB=$(dirname $(realpath $0))
else
export QADB=$(dirname $(realpath ${BASH_SOURCE[0]}))
fi

JYPATH="${JYPATH}:${QADB}/src/"
export JYPATH=$(echo $JYPATH | sed 's/^://')
Expand Down
2 changes: 0 additions & 2 deletions src/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ also the C++ implementation.
* use `${COATJAVA}/bin/run-groovy` to execute these examples
* it is useful to have `${COATJAVA}/bin` in your `$PATH`
* most of the example scripts require a HIPO file as an argument
* example scripts named `test*.groovy` are actually developer tools for
testing the QADB, but may also be useful as additional examples
125 changes: 0 additions & 125 deletions src/examples/test1.groovy

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions srcC/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ groovy implementation.
* compile examples with `make`
* executables `*.exe` will appear; most of them require a HIPO file as an
argument
* example programs named `test*.cpp` are actually developer tools for
testing the QADB, but may also be useful as additional examples
143 changes: 0 additions & 143 deletions srcC/examples/test1.cpp

This file was deleted.

29 changes: 29 additions & 0 deletions srcC/tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
CXX = g++ -std=c++11
FLAGS = -g -Wno-deprecated -fPIC -m64 -fno-inline -Wno-write-strings

# QADB and rapidjson
DEPS += -I$(QADB)/srcC/rapidjson/include -I$(QADB)/srcC/include

#--------------------------------------------

SOURCES := $(basename $(wildcard *.cpp))
EXES := $(addsuffix .exe, $(SOURCES))

#--------------------------------------------

all:
make exe

exe: $(EXES)

%.exe: %.o
@echo "--- make executable $@"
$(CXX) -o $@ $< $(LIBS)

%.o: %.cpp
@echo "----- build $@ -----"
$(CXX) -c $^ -o $@ $(FLAGS) $(DEPS)

clean:
@echo "----- clean -----"
$(RM) $(EXES)
File renamed without changes.
File renamed without changes.
Loading