Skip to content

Commit 79f8ead

Browse files
committed
[MAINT] use same testing strategy as for moxunit
1 parent f80e34a commit 79f8ead

File tree

4 files changed

+89
-27
lines changed

4 files changed

+89
-27
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# Documentation
3+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
4+
version: 2
5+
updates:
6+
- package-ecosystem: github-actions
7+
directory: /
8+
schedule:
9+
interval: monthly

.github/workflows/CI_matlab.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,41 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
matlab_version: [R2023a]
16-
os: [windows-latest]
17-
fail-fast: false
15+
# Note that some older versions (e.g R2020a, R2020b...) may not be available on all OS
16+
matlab_version: [R2022a, R2022b, R2023a, R2023b]
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
fail-fast: false # Don't cancel all jobs if one fails
1819

1920
runs-on: ${{ matrix.os }}
2021

2122
steps:
2223

23-
# use matlab-actions/setup-matlab to setup a specific version of MATLAB
24-
# https://github.com/matlab-actions/setup-matlab
24+
# use matlab-actions/setup-matlab to setup a specific version of MATLAB
25+
# https://github.com/matlab-actions/setup-matlab
2526
- name: Install MATLAB
26-
uses: matlab-actions/setup-matlab@v1.2.4
27+
uses: matlab-actions/setup-matlab@v2
2728
with:
2829
release: ${{ matrix.matlab_version }}
2930

3031
- name: Checkout repository
31-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3233

3334
- name: Install Moxunit
34-
run: |
35-
git clone https://github.com/MOxUnit/MOxUnit.git --depth 1
35+
run: git clone https://github.com/MOxUnit/MOxUnit.git --depth 1
3636

37-
# use matlab-actions/setup-matlab to run a matlab command
38-
# https://github.com/matlab-actions/setup-matlab
37+
# use matlab-actions/setup-matlab to run a matlab command
38+
# https://github.com/matlab-actions/setup-matlab
3939
- name: Run tests on dummy source code to test MoCov
40-
uses: matlab-actions/run-command@v1.1.3
40+
uses: matlab-actions/run-command@v2
4141
with:
4242
command: cd('./MOxUnit/MOxUnit/'); moxunit_set_path(); cd ../..; addpath(fullfile(pwd, 'MOcov')); moxunit_runtests tests -verbose -recursive
4343
-with_coverage -cover tests/regression/src -cover_xml_file coverage.xml; exit(double(~ans))
44+
45+
- name: Code coverage
46+
uses: codecov/codecov-action@v5
47+
with:
48+
files: coverage.xml
49+
flags: ${{ matrix.os }}_matlab-${{ matrix.matlab_version }}
50+
name: codecov-matlab
51+
fail_ci_if_error: false
52+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/CI_octave.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: CI octave
3+
4+
# - Installs
5+
# - octave
6+
# - MOcov
7+
# - checks out MOXunit
8+
# - Runs tests
9+
# - If tests pass, uploads coverage to codecov
10+
11+
# Controls when the action will run.
12+
# Triggers the workflow:
13+
# - on push for the master branch
14+
# - on pull request for all branches
15+
on:
16+
push:
17+
branches: [master]
18+
pull_request:
19+
branches: ['*']
20+
21+
# cancel previous runs on the same branch / PR
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
env:
27+
OCTFLAGS: --no-gui --no-window-system --silent
28+
29+
jobs:
30+
tests:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Install Moxunit
37+
run: git clone https://github.com/MOxUnit/MOxUnit.git --depth 1
38+
39+
- name: Install Octave
40+
run: |
41+
sudo apt-get -y -qq update
42+
sudo apt-get -y install octave
43+
make -C MOxUnit install
44+
make install
45+
46+
- name: Octave version
47+
run: octave --version
48+
49+
- name: Run tests
50+
run: octave $OCTFLAGS --eval "moxunit_runtests tests -verbose -with_coverage -cover MOcov -cover_xml_file coverage.xml; exit(double(~ans))"
51+
52+
- name: Code coverage
53+
uses: codecov/codecov-action@v5
54+
with:
55+
files: coverage.xml
56+
flags: octave
57+
name: codecov-octave
58+
fail_ci_if_error: false
59+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/moxunit_tests.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)