diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 482e1937e1..3f18263e9e 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -202,6 +202,9 @@ jobs: packaging: runs-on: ubuntu-latest + env: + QUICKTEST: True + shell: bash steps: - uses: actions/checkout@v2 with: @@ -229,51 +232,57 @@ jobs: # however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated # fresh torch installation according to pyproject.toml python -m pip install torch>=1.5 torchvision - - name: Test source archive and wheel file + - name: Check packages run: | pip uninstall monai pip list | grep -iv monai git fetch --depth=1 origin +refs/tags/*:refs/tags/* - root_dir=$PWD - echo "$root_dir" set -e # build tar.gz and wheel python setup.py check -m -s python setup.py sdist bdist_wheel python -m twine check dist/* - + - run: echo "::set-output name=pwd::$PWD" + id: root + - run: echo "::set-output name=tmp_dir::$(mktemp -d)" + id: mktemp + - name: Move packages + run: | + printf ${{ steps.root.outputs.pwd }} + printf ${{ steps.mktemp.outputs.tmp_dir }} # move packages to a temp dir - tmp_dir=$(mktemp -d) - cp dist/monai* "$tmp_dir" + cp dist/monai* "${{ steps.mktemp.outputs.tmp_dir }}" rm -r build dist monai.egg-info - cd "$tmp_dir" + cd "${{ steps.mktemp.outputs.tmp_dir }}" ls -al - + - name: Install wheel file + working-directory: ${{ steps.mktemp.outputs.tmp_dir }} + run: | # install from wheel python -m pip install monai*.whl python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown" python -c 'import monai; print(monai.__file__)' python -m pip uninstall -y monai rm monai*.whl - + - name: Install source archive + working-directory: ${{ steps.mktemp.outputs.tmp_dir }} + run: | # install from tar.gz name=$(ls *.tar.gz | head -n1) echo $name python -m pip install $name[all] python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown" python -c 'import monai; print(monai.__file__)' - + - name: Quick test + working-directory: ${{ steps.mktemp.outputs.tmp_dir }} + run: | # run min tests - cp $root_dir/requirements*.txt "$tmp_dir" - cp -r $root_dir/tests "$tmp_dir" - pwd + cp ${{ steps.root.outputs.pwd }}/requirements*.txt . + cp -r ${{ steps.root.outputs.pwd }}/tests . ls -al python -m pip install -r requirements-dev.txt python -m unittest -v - env: - QUICKTEST: True - shell: bash build-docs: runs-on: ubuntu-latest