From ddd65b37a97b0c81a4fcb6790d0036b84b776955 Mon Sep 17 00:00:00 2001 From: Tim Heap Date: Tue, 7 Feb 2023 13:53:09 +1100 Subject: [PATCH] Add tag matching --- .github/workflows/ci.yaml | 99 ++++----------------------------------- 1 file changed, 10 insertions(+), 89 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 82503a6..2a1f144 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,98 +35,11 @@ jobs: name: "Python package" path: dist - test: - runs-on: ubuntu-latest - timeout-minutes: 10 - needs: ["build"] - - strategy: - fail-fast: false - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/environment - with: - python-version: ${{ matrix.python-version }} - - - name: Run tests - shell: bash -l {0} - run: | - pytest -v \ - --junitxml=junit-py${{ matrix.python-version }}.xml \ - --cov --cov-report term \ - --cov-report xml:coverage-${{ matrix.python-version }}.xml - - - name: JUnit Report - uses: mikepenz/action-junit-report@v3 - if: always() - with: - report_paths: 'junit-py*.xml' - check_name: "JUnit Test Report - Python ${{ matrix.python-version }}" - - - uses: actions/upload-artifact@v3 - with: - name: Code coverage for Python ${{ matrix.python-version }} - path: coverage-*.xml - - lint: - runs-on: ubuntu-latest - timeout-minutes: 10 - needs: ["build"] - - defaults: - run: - shell: bash -l {0} - - env: - python_version: "3.11" - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/environment - with: - python-version: ${{ env.python_version }} - - - name: 'mypy cache' - uses: actions/cache@v3 - with: - path: '.mypy_cache' - key: mypy-${{ runner.os }}-py${{ env.python_version }}-${{ hashFiles('requirements.txt') }} - - - run: flake8 src/ tests/ - - run: isort --diff --check-only src/ tests/ - - run: mypy --junit-xml report-mypy.xml src/ - - docs: - runs-on: ubuntu-latest - timeout-minutes: 10 - needs: ["build"] - - defaults: - run: - shell: bash -l {0} - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/environment - with: - python-version: "3.11" - - - run: | - cd docs/ - sphinx-build -b dirhtml -aEW . _build/dirhtml - - - uses: actions/upload-artifact@v3 - with: - name: Docs - path: docs/_build/dirhtml - publish: runs-on: ubuntu-latest timeout-minutes: 5 - needs: ['test', 'lint', 'docs'] + # needs: ['test', 'lint', 'docs'] + needs: ['build'] if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') steps: @@ -135,6 +48,14 @@ jobs: with: name: "Python package" + - name: "Check tag matches version" + shell: bash -l {0} + run: | + VERSION="$( echo "${{ github.ref }}" | sed 's!refs/tags/v!!' )" + echo "Looking for packages with version $VERSION" + test -e "dist/emsarray-$VERSION.tar.gz" + test -e "dist/emsarray-$VERSION-*.whl" + - name: "Publish Python package" uses: pypa/gh-action-pypi-publish@release/v1 with: