Skip to content

Commit 8c212f9

Browse files
Merge pull request #393 from rsagroup/styling-and-typing-workflows
workflows for styling and typing
2 parents 71f0307 + ae0a8b8 commit 8c212f9

27 files changed

+359
-743
lines changed

.bandit

-2
This file was deleted.

.github/workflows/testbuild.yml

+73
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,79 @@ jobs:
3434
- name: Unit tests
3535
run: pytest
3636

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

0 commit comments

Comments
 (0)