-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.74 KB
/
reusable_check_code.yml
File metadata and controls
49 lines (42 loc) · 1.74 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
name: Analyse code
on:
workflow_call:
inputs:
code_directory:
description: Path to the directory containing code. Code analysis will run on the contents of this folder and its subfolders.
type: string
default: 'code'
tools_directory:
description: Path to the directory containing CI tools. Used for locating customized MatBox tasks.
type: string
default: 'tools'
matlab_release:
description: MATLAB release to use when running code analysis.
type: string
default: 'latest'
jobs:
# This workflow contains a single job called "check"
check:
name: Check code
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up MATLAB (${{ inputs.matlab_release }})
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ inputs.matlab_release }}
cache: true
- name: Install MatBox
uses: ehennestad/matbox/.github/actions/install-matbox@v0.9
- name: Check code and upload report
uses: ehennestad/matbox/.github/actions/check-code@v0.9
with:
code_directory: ${{ inputs.code_directory }}
tools_directory: ${{ inputs.tools_directory }}
- name: Commit SVG badges if updated
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: ehennestad/matbox/.github/actions/push-badges@v0.9
with:
pr-ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
pr-repo: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }}