Skip to content

Commit 9f56a3a

Browse files
authored
Move PyType test to weekly test (#8025)
Fixes #8022 ### Description - Add format test to weekly test - Set pytype test as not required in each PR - Add packaging in weekly-preview pipeline ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: YunLiu <[email protected]>
1 parent 7b9a523 commit 9f56a3a

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

.github/workflows/weekly-preview.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,39 @@ on:
55
- cron: "0 2 * * 0" # 02:00 of every Sunday
66

77
jobs:
8+
flake8-py3:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
opt: ["codeformat", "pytype", "mypy"]
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python 3.9
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.9'
19+
- name: cache weekly timestamp
20+
id: pip-cache
21+
run: |
22+
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
23+
- name: cache for pip
24+
uses: actions/cache@v4
25+
id: cache
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
29+
- name: Install dependencies
30+
run: |
31+
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
32+
python -m pip install --upgrade pip wheel
33+
python -m pip install -r requirements-dev.txt
34+
- name: Lint and type check
35+
run: |
36+
# clean up temporary files
37+
$(pwd)/runtests.sh --build --clean
38+
# Github actions have 2 cores, so parallelize pytype
39+
$(pwd)/runtests.sh --build --${{ matrix.opt }} -j 2
40+
841
packaging:
942
if: github.repository == 'Project-MONAI/MONAI'
1043
runs-on: ubuntu-latest
@@ -19,7 +52,7 @@ jobs:
1952
python-version: '3.9'
2053
- name: Install setuptools
2154
run: |
22-
python -m pip install --user --upgrade setuptools wheel
55+
python -m pip install --user --upgrade setuptools wheel packaging
2356
- name: Build distribution
2457
run: |
2558
export HEAD_COMMIT_ID=$(git rev-parse HEAD)

0 commit comments

Comments
 (0)