diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/python-tests.yml | 65 |
1 files changed, 23 insertions, 42 deletions
diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index af4126b..a9d4eed 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -16,7 +16,20 @@ env: FORCE_COLOR: 1 jobs: + + package: + name: Build & inspect our package. + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: hynek/build-and-inspect-python-package@v1 + test: + needs: [package] runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -66,9 +79,14 @@ jobs: echo "C:\Program Files (x86)\gnupg\bin" >> $env:GITHUB_PATH git config --system gpg.program "C:\Program Files (x86)\gnupg\bin\gpg.exe" if: runner.os == 'Windows' - - run: pip install -U 'setuptools>=45' + - run: pip install -U 'setuptools>=60' if: matrix.python_version != 'msys2' - - run: pip install -e .[toml,test] + - uses: actions/download-artifact@v3 + with: + name: Packages + path: dist + - shell: bash + run: pip install "$(echo -n dist/*whl)[toml,test]" - run: | $(hg debuginstall --template "{pythonexe}") -m pip install hg-git --user if: matrix.os == 'ubuntu-latest' @@ -81,58 +99,21 @@ jobs: - name: Setup python uses: actions/setup-python@v4 with: - python-version: "3.7" + python-version: "3.8" architecture: x64 - run: pip install -e .[toml,test] pytest virtualenv - run: pytest --test-legacy testing/test_setuptools_support.py || true # ignore fail flaky on ci - dist: - runs-on: ubuntu-latest - - needs: [test] - name: Python sdist/wheel - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade wheel setuptools build - - - name: Build package - run: python -m build -o dist/ - - uses: actions/upload-artifact@v3 - with: - name: dist - path: dist - - - dist_check: - runs-on: ubuntu-latest - needs: [dist] - steps: - - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - name: Install dependencies - run: pip install twine - - uses: actions/download-artifact@v3 - with: - name: dist - path: dist - - run: twine check --strict dist/* dist_upload: runs-on: ubuntu-latest if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - needs: [dist_check] + needs: [test] steps: - uses: actions/download-artifact@v3 with: - name: dist + name: Packages path: dist - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@master |