-
Notifications
You must be signed in to change notification settings - Fork 437
48 lines (39 loc) · 1.4 KB
/
pyre.yml
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
name: pyre
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
pyre:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: 3.x
- name: Install Dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install cython flask flask_cors graphql-core typing_inspect
VERSION=$(grep "version" .pyre_configuration | sed -n -e 's/.*\(0\.0\.[0-9]*\).*/\1/p')
pip install pyre-check-nightly==$VERSION
- name: Run Pyre
continue-on-error: true
run: |
pyre -n --output=sarif check > sarif.json
- name: Expose SARIF Results
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: SARIF Results
path: sarif.json
- name: Upload SARIF Results
uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
sarif_file: sarif.json
- name: Fail Command On Errors
run: |
if [ "$(cat sarif.json | grep 'PYRE-ERROR')" != "" ]; then python -m json.tool sarif.json && exit 1; fi