Make test_tokamak_parameter spawn-safe #1206
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: Build | |
| # yamllint disable-line rule:truthy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| pull_request: | |
| branches: | |
| - main | |
| - dev | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build: | |
| if: | | |
| github.event_name == 'push' || | |
| github.event_name == 'release' || | |
| github.event.pull_request.draft == false | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install poetry | |
| run: pipx install poetry | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| cache: 'poetry' | |
| - name: Print versions | |
| run: | | |
| python --version | |
| poetry --version | |
| - name: Poetry check | |
| run: poetry check --lock | |
| - name: Poetry install | |
| run: make install-all | |
| - name: Test import | |
| run: poetry run python -c "import disruption_py" | |
| - name: Discard dev package | |
| if: github.event_name == 'release' | |
| run: "! poetry version | grep dev" | |
| - name: Build package | |
| run: poetry build | |
| - name: Publish package | |
| if: github.event_name == 'release' | |
| env: | |
| POETRY_PYPI_TOKEN_PYPI: "${{ secrets.PYPI_TOKEN }}" | |
| run: poetry publish |