-
-
Notifications
You must be signed in to change notification settings - Fork 488
84 lines (74 loc) · 2.58 KB
/
pyright.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
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
name: Static check with Pyright
on:
pull_request:
merge_group:
push:
branches:
- master
- develop
workflow_dispatch:
# Allow to run manually
concurrency:
# Cancel previous runs of this workflow for the same branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pyright:
runs-on: ubuntu-latest
container: ghcr.io/sagemath/sage/sage-ubuntu-jammy-standard-with-targets:dev
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Update system packages
id: prepare
run: |
export PATH="build/bin:$PATH"
eval $(sage-print-system-package-command auto update)
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git)
- name: Install GH CLI
uses: dev-hanz-ops/install-gh-cli-action@v0.2.0
with:
gh-cli-version: 2.32.0
- name: Merge CI fixes from sagemath/sage
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
.ci/merge-fixes.sh
- name: Add prebuilt tree as a worktree
id: worktree
run: |
set -ex
.ci/retrofit-worktree.sh worktree-image /sage
- name: Incremental build (sagelib deps)
id: incremental
run: |
# Now re-bootstrap and build. The build is incremental because we were careful with the timestamps.
# pyright does not need a built sagelib; it only needs
# the libraries from which sagelib imports.
./bootstrap && make sagelib-build-deps
working-directory: ./worktree-image
env:
MAKE: make -j2 --output-sync=recurse
SAGE_NUM_THREADS: 2
- name: Static code check with pyright
uses: jakebailey/pyright-action@v1
with:
version: 1.1.332
# Many warnings issued by pyright are not yet helpful because there is not yet enough type information.
no-comments: true
working-directory: ./worktree-image
env:
# To avoid out of memory errors
NODE_OPTIONS: --max-old-space-size=8192
- name: Static code check with pyright (annotated)
if: (success() || failure()) && steps.incremental.outcome == 'success'
uses: jakebailey/pyright-action@v1
with:
version: 1.1.332
# Issue errors
no-comments: false
level: error
working-directory: ./worktree-image
env:
# To avoid out of memory errors
NODE_OPTIONS: --max-old-space-size=8192