Skip to content

Commit de48151

Browse files
committed
Signed-off-by: YunLiu <[email protected]>
1 parent 7b9a523 commit de48151

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)