From de481510c5aa91a8ede76b56f1f86a1861477ce6 Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:46:21 +0800 Subject: [PATCH 1/3] fix #8022 Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> --- .github/workflows/weekly-preview.yml | 35 +++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index e94e1dac5a..8d8cccffad 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -5,6 +5,39 @@ on: - cron: "0 2 * * 0" # 02:00 of every Sunday jobs: + flake8-py3: + runs-on: ubuntu-latest + strategy: + matrix: + opt: ["codeformat", "pytype", "mypy"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: '3.9' + - name: cache weekly timestamp + id: pip-cache + run: | + echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT + - name: cache for pip + uses: actions/cache@v4 + id: cache + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }} + - name: Install dependencies + run: | + find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; + python -m pip install --upgrade pip wheel + python -m pip install -r requirements-dev.txt + - name: Lint and type check + run: | + # clean up temporary files + $(pwd)/runtests.sh --build --clean + # Github actions have 2 cores, so parallelize pytype + $(pwd)/runtests.sh --build --${{ matrix.opt }} -j 2 + packaging: if: github.repository == 'Project-MONAI/MONAI' runs-on: ubuntu-latest @@ -19,7 +52,7 @@ jobs: python-version: '3.9' - name: Install setuptools run: | - python -m pip install --user --upgrade setuptools wheel + python -m pip install --user --upgrade setuptools wheel packaging - name: Build distribution run: | export HEAD_COMMIT_ID=$(git rev-parse HEAD) From 3563341e1c8bc4c133f5ddbc7ba9b2d50c7cfc8c Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:49:38 +0800 Subject: [PATCH 2/3] temp test Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> --- .github/workflows/weekly-preview.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index 8d8cccffad..55e8a6ab2c 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -1,8 +1,11 @@ name: weekly-preview on: - schedule: - - cron: "0 2 * * 0" # 02:00 of every Sunday + # schedule: + # - cron: "0 2 * * 0" # 02:00 of every Sunday + pull_request: + head_ref-ignore: + - dev jobs: flake8-py3: From 73ad153e0e9f60343f09f524407988eaf03003c9 Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:05:56 +0800 Subject: [PATCH 3/3] revert test Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> --- .github/workflows/weekly-preview.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index 55e8a6ab2c..8d8cccffad 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -1,11 +1,8 @@ name: weekly-preview on: - # schedule: - # - cron: "0 2 * * 0" # 02:00 of every Sunday - pull_request: - head_ref-ignore: - - dev + schedule: + - cron: "0 2 * * 0" # 02:00 of every Sunday jobs: flake8-py3: