Skip to content

Commit df784e0

Browse files
Merge pull request #414 from rsagroup/fix-style-typing-jobs-main
Separate workflow for style and typing (non-forked pr)
2 parents 2b22375 + c8cc151 commit df784e0

File tree

3 files changed

+79
-73
lines changed

3 files changed

+79
-73
lines changed

Diff for: .github/workflows/publish.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
name: Publish
42

53
on:
@@ -11,7 +9,6 @@ on:
119

1210
permissions:
1311
contents: read
14-
statuses: write
1512

1613
jobs:
1714
call-test-build:

Diff for: .github/workflows/style.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Style and Typing checks
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
contents: read
9+
statuses: write
10+
11+
jobs:
12+
13+
style:
14+
runs-on: ubuntu-22.04
15+
env:
16+
GH_TOKEN: ${{ github.token }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
- name: Install dependencies
25+
run: pip install ruff
26+
- name: Ruff output to file
27+
run: ruff check -ne -o ruff.log --output-format concise
28+
- name: Ruff output as annotations
29+
run: echo "$(ruff check -e --output-format github)"
30+
- name: Process Ruff output
31+
run: python devops/style_assistant.py ${{ github.run_id }} ${{ github.job }} ${{ github.event.pull_request.head.sha }}
32+
- name: Report status
33+
run: gh api ${{ env.DEVOPS_ASST_API_ARGS }}
34+
35+
36+
typing:
37+
runs-on: ubuntu-22.04
38+
env:
39+
GH_TOKEN: ${{ github.token }}
40+
steps:
41+
- uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.11'
44+
- name: Python Version
45+
run: python --version
46+
- name: Update Pip
47+
run: python -m pip install --upgrade pip
48+
- name: Install dependencies
49+
run: pip install build setuptools pandas-stubs types-tqdm pyright
50+
- uses: actions/checkout@v4
51+
with:
52+
ref: main
53+
fetch-depth: 0
54+
- name: Build package
55+
run: python -m build --sdist
56+
- name: Install rsatoolbox
57+
run: pip install dist/*
58+
- name: Pyright (on main)
59+
continue-on-error: true
60+
run: pyright > pyright_main.log
61+
- name: Uninstall rsatoolbox
62+
run: pip uninstall -y rsatoolbox
63+
- name: Remove builds
64+
run: rm dist/*
65+
- uses: actions/checkout@v4
66+
with:
67+
clean: false
68+
fetch-depth: 0
69+
- name: Build package
70+
run: python -m build --sdist
71+
- name: Install rsatoolbox
72+
run: pip install dist/*
73+
- name: Pyright (on PR)
74+
continue-on-error: true
75+
run: pyright > pyright_pr.log
76+
- name: Process Pyright output
77+
run: python devops/typing_assistant.py ${{ github.run_id }} ${{ github.job }} ${{ github.event.pull_request.head.sha }}
78+
- name: Report status
79+
run: gh api ${{ env.DEVOPS_ASST_API_ARGS }}

Diff for: .github/workflows/testbuild.yml

-70
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77

88
permissions:
99
contents: read
10-
statuses: write
1110

1211
jobs:
1312

@@ -35,75 +34,6 @@ jobs:
3534
- name: Unit tests
3635
run: pytest
3736

38-
style:
39-
runs-on: ubuntu-22.04
40-
env:
41-
GH_TOKEN: ${{ github.token }}
42-
steps:
43-
- uses: actions/checkout@v4
44-
with:
45-
fetch-depth: 0
46-
- uses: actions/setup-python@v5
47-
with:
48-
python-version: '3.11'
49-
- name: Install dependencies
50-
run: pip install ruff
51-
- name: Ruff output to file
52-
run: ruff check -ne -o ruff.log --output-format concise
53-
- name: Ruff output as annotations
54-
run: echo "$(ruff check -e --output-format github)"
55-
- name: Process Ruff output
56-
run: python devops/style_assistant.py ${{ github.run_id }} ${{ github.job }} ${{ github.event.pull_request.head.sha }}
57-
- name: Report status
58-
run: gh api ${{ env.DEVOPS_ASST_API_ARGS }}
59-
60-
61-
typing:
62-
runs-on: ubuntu-22.04
63-
env:
64-
GH_TOKEN: ${{ github.token }}
65-
steps:
66-
- uses: actions/setup-python@v5
67-
with:
68-
python-version: '3.11'
69-
- name: Python Version
70-
run: python --version
71-
- name: Update Pip
72-
run: python -m pip install --upgrade pip
73-
- name: Install dependencies
74-
run: pip install build setuptools pandas-stubs types-tqdm pyright
75-
- uses: actions/checkout@v4
76-
with:
77-
ref: main
78-
fetch-depth: 0
79-
- name: Build package
80-
run: python -m build --sdist
81-
- name: Install rsatoolbox
82-
run: pip install dist/*
83-
- name: Pyright (on main)
84-
continue-on-error: true
85-
run: pyright > pyright_main.log
86-
- name: Uninstall rsatoolbox
87-
run: pip uninstall -y rsatoolbox
88-
- name: Remove builds
89-
run: rm dist/*
90-
- uses: actions/checkout@v4
91-
with:
92-
clean: false
93-
fetch-depth: 0
94-
- name: Build package
95-
run: python -m build --sdist
96-
- name: Install rsatoolbox
97-
run: pip install dist/*
98-
- name: Pyright (on PR)
99-
continue-on-error: true
100-
run: pyright > pyright_pr.log
101-
- name: Process Pyright output
102-
run: python devops/typing_assistant.py ${{ github.run_id }} ${{ github.job }} ${{ github.event.pull_request.head.sha }}
103-
- name: Report status
104-
run: gh api ${{ env.DEVOPS_ASST_API_ARGS }}
105-
106-
10737
source:
10838
needs: tests
10939
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)