-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (93 loc) · 2.94 KB
/
Testing.yml
File metadata and controls
110 lines (93 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# This is a basic workflow to help you get started with Actions
name: Unit_Tests
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request on main branch
push:
branches:
- main
- dev
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
test:
strategy:
matrix:
version: [R2024b, R2023b, R2022b, R2021a]
os: [ubuntu-latest, windows-latest]
include:
- os: macos-14
version: R2024b
- os: macos-14
version: R2023b
fail-fast: false
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: make failing artifact
shell: bash
run: |
echo "{
\"os\": \"${{matrix.os}}\",
\"version\": \"${{matrix.version}}\",
\"status\": \"fail\"
}" > ${{matrix.os}}-${{matrix.version}}-results.json
- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ matrix.version }}
- name: Run tests
uses: matlab-actions/run-tests@v2
- name: make passing artifact
shell: bash
run: |
echo "{
\"os\": \"${{matrix.os}}\",
\"version\": \"${{matrix.version}}\",
\"status\": \"pass\"
}" > ${{matrix.os}}-${{matrix.version}}-results.json
- name: upload artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{matrix.os}}-${{matrix.version}}-results
path: ${{matrix.os}}-${{matrix.version}}-results.json
retention-days: 1
compression-level: 0
make_badge:
runs-on: ubuntu-latest
if: always()
needs: [test]
env:
badge_gist: gist.github.com/0f25477c0a3820599438e573cee862a3.git
badge_dir: ./badge_gist
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: ./artifacts
- name: make badge svg
shell: bash
run: python make_badge.py
- name: upload badge to gist
uses: ./.github/actions/upload-to-gist
with:
file_name: badge.svg
file_path: ./artifacts/badge.svg
gist_path: gist.github.com/0f25477c0a3820599438e573cee862a3.git
token: ${{secrets.BADGE_SECRET}}