Merge pull request #119 from UBC-MDS/dev #44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: deploy-test-pypi | ||
| on: | ||
| push: | ||
| #branches: [main] | ||
| tags: | ||
| - "v*" | ||
| workflow_dispatch: | ||
| jobs: | ||
| unit-test-and-lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check-out repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e ".[tests]" | ||
| pip install ruff | ||
| - name: Style check | ||
| run: | | ||
| ruff check src/ | ||
| - name: Run tests with coverage | ||
| run: | | ||
| pytest --cov --cov-report=xml --cov-branch | ||
| - name: Upload coverage reports to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| build-deploy: | ||
| needs: unit-test-and-lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check-out repository | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install hatch | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install hatch | ||
| - name: Build package | ||
| run: | | ||
| hatch build | ||
| - name: Publish to TestPyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| user: __token__ | ||
| repository-url: https://test.pypi.org/legacy/ | ||
| password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
| verbose: true | ||
| #skip-existing: true | ||