Redesign to object-oriented structure #181
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: Python application | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: pdm-project/setup-pdm@v4 | |
| - name: Install dependencies | |
| run: | | |
| set +x | |
| python -m pip install --upgrade pip | |
| pdm install -G test | |
| - name: Run tests | |
| run: | | |
| pdm run test | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| # Only publish on master | |
| if: github.ref == 'refs/heads/master' | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up PDM | |
| uses: pdm-project/setup-pdm@v4 | |
| - name: Publish wheel | |
| env: | |
| PDM_PUBLISH_USERNAME: __token__ | |
| PDM_PUBLISH_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: pdm publish |