|
| 1 | +name: tests and coverage |
| 2 | + |
| 3 | +# Uses the cron schedule for github actions |
| 4 | +# |
| 5 | +# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#scheduled-events |
| 6 | +# |
| 7 | +# ┌───────────── minute (0 - 59) |
| 8 | +# │ ┌───────────── hour (0 - 23) |
| 9 | +# │ │ ┌───────────── day of the month (1 - 31) |
| 10 | +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) |
| 11 | +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) |
| 12 | +# │ │ │ │ │ |
| 13 | +# │ │ │ │ │ |
| 14 | +# │ │ │ │ │ |
| 15 | +# * * * * * |
| 16 | + |
| 17 | +on: |
| 18 | + push: |
| 19 | + branches: |
| 20 | + - dev |
| 21 | + pull_request: |
| 22 | + branches: '*' |
| 23 | + schedule: |
| 24 | + - cron: "* * 1 * *" |
| 25 | + |
| 26 | +env: |
| 27 | + OCTFLAGS: --no-gui --no-window-system --silent |
| 28 | + |
| 29 | +jobs: |
| 30 | + build: |
| 31 | + |
| 32 | + runs-on: ubuntu-20.04 |
| 33 | + |
| 34 | + steps: |
| 35 | + |
| 36 | + - name: Install dependencies |
| 37 | + run: | |
| 38 | + sudo apt-get -y -qq update |
| 39 | + sudo apt-get -y install octave liboctave-dev |
| 40 | + sudo apt-get -y install nodejs npm |
| 41 | +
|
| 42 | + - name: Clone cpp_spm |
| 43 | + uses: actions/checkout@v2 |
| 44 | + with: |
| 45 | + submodules: true |
| 46 | + fetch-depth: 2 |
| 47 | + |
| 48 | + - name: Install SPM |
| 49 | + run: | |
| 50 | + git clone https://github.com/spm/spm12.git --depth 1 |
| 51 | + make -C spm12/src PLATFORM=octave distclean |
| 52 | + make -C spm12/src PLATFORM=octave |
| 53 | + make -C spm12/src PLATFORM=octave install |
| 54 | + octave $OCTFLAGS --eval "addpath(fullfile(pwd, 'spm12')); savepath();" |
| 55 | +
|
| 56 | + - name: Install Moxunit and MOcov |
| 57 | + run: | |
| 58 | + git clone https://github.com/MOxUnit/MOxUnit.git --depth 1 |
| 59 | + make -C MOxUnit install |
| 60 | + git clone https://github.com/MOcov/MOcov.git --depth 1 |
| 61 | + make -C MOcov install |
| 62 | + |
| 63 | + - name: Update octave path |
| 64 | + run: | |
| 65 | + octave $OCTFLAGS --eval "initCppRoi; savepath();" |
| 66 | + octave $OCTFLAGS --eval "addpath(fullfile(pwd, 'tests', 'utils')); savepath();" |
| 67 | +
|
| 68 | + - name: Run tests |
| 69 | + run: | |
| 70 | + octave $OCTFLAGS --eval "runTests" |
| 71 | + cat test_report.log | grep 0 |
| 72 | + bash <(curl -s https://codecov.io/bash) |
| 73 | +
|
0 commit comments