Modernize hackable_diffusion build: replace requirements.txt with pyp… #2
Workflow file for this run
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: Unittests & Auto-publish | |
| # Allow to trigger the workflow manually (e.g. when deps changes) | |
| on: [push, workflow_dispatch] | |
| jobs: | |
| pytest-job: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.11', '3.12'] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.python-version }} | |
| cancel-in-progress: true | |
| steps: | |
| - uses: actions/checkout@v3 | |
| # Install deps | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: pip --version | |
| - run: pip install --no-cache-dir -e .[dev] | |
| - run: pip freeze | |
| # Run tests | |
| - name: Run core tests | |
| run: pytest -vv -n auto | |
| # Auto-publish when version is increased | |
| publish-job: | |
| if: | | |
| github.repository == 'google/hackable_diffusion' | |
| && github.ref == 'refs/heads/main' | |
| needs: pytest-job | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: etils-actions/pypi-auto-publish@v1 | |
| with: | |
| pypi-token: ${{ secrets.PYPI_API_TOKEN }} | |
| gh-token: ${{ secrets.GITHUB_TOKEN }} | |
| parse-changelog: true |