-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (56 loc) · 1.82 KB
/
static_analysis.yml
File metadata and controls
62 lines (56 loc) · 1.82 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
name: Static Analysis
on:
push:
branches:
- main
# filter on files that should trigger this workflow
paths:
- "pyproject.toml"
- "**.py"
- ".github/workflows/static_analysis.yml"
pull_request:
# filter on files that should trigger this workflow
paths:
- "pyproject.toml"
- "**.py"
- ".github/workflows/static_analysis.yml"
workflow_dispatch:
workflow_call:
# Only cancel concurrent runs of the same workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-linting
cancel-in-progress: true
jobs:
static_analysis:
name: Run Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3.5.2
- name: Setup Python
uses: actions/setup-python@v4.5.0
with:
python-version: "3.7"
cache: "pip" # cache dependencies
cache-dependency-path: "pyproject.toml"
- name: Install Project Dependencies
run: |
# install dev because we import pytest in truelearn.tests
pip install .[dev]
- name: Run Prospector
run: |
# Outputs the xunit report to project root
# Uses prospector.yml config file
prospector --output-format xunit:prospector_report.xml
# NOTE: Because it expects a Junit format,
# the line numberings on the annotation header defaults to 1
# However the error message shows the correct line numbering.
- name: Convert test results to Github Annotations
uses: mikepenz/action-junit-report@v3
# Only produce check run annotations if the tests fail
if: failure()
with:
# Report in project root
report_paths: ./prospector_report.xml
check_name: "Prospector Analysis Report"
detailed_summary: true