From 9f56a3a02eef613546a1a19e98e36627c961c650 Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Mon, 19 Aug 2024 23:09:10 +0800 Subject: [PATCH] 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 - [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 <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)