Ignore only when running in CI #467
This file contains 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 | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: 0 0 * * 0 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
poetry-version: ["1.4.0"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@v2.0.0 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Cache Poetry virtualenv | |
uses: actions/cache@v4 | |
id: cache | |
with: | |
path: ~/.virtualenvs | |
key: poetry-$ | |
restore-keys: | | |
poetry-$ | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
poetry install | |
- name: Build | |
run: poetry build | |
- name: Run tests | |
run: | | |
poetry run pytest --cov=webcomix | |
poetry run mypy . --ignore-missing-imports | |
- name: Coveralls | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
run: poetry run coveralls | |
supported_comics: | |
runs-on: ubuntu-latest | |
env: | |
CI: true | |
strategy: | |
matrix: | |
python-version: ["3.9"] | |
poetry-version: ["1.4.0"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@v2.0.0 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Cache Poetry virtualenv | |
uses: actions/cache@v4 | |
id: cache | |
with: | |
path: ~/.virtualenvs | |
key: poetry-$ | |
restore-keys: | | |
poetry-$ | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
poetry install | |
- name: Build | |
run: poetry build | |
- name: Run tests | |
run: | | |
poetry run pytest -n auto -m "slow" --check-supported-comics | |
deploy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9"] | |
needs: [build, supported_comics] | |
permissions: | |
id-token: write | |
contents: write | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1.3.1 | |
- name: Cache Poetry virtualenv | |
uses: actions/cache@v4 | |
id: cache | |
with: | |
path: ~/.virtualenvs | |
key: poetry-$ | |
restore-keys: | | |
poetry-$ | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
poetry install | |
- name: Set RELEASE_VERSION | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Build | |
run: poetry build | |
- name: Publish package on PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
- name: Publish package on GitHub Releases | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: webcomix ${{ github.ref_name }} | |
body: | | |
## Changelog | |
* Insert change here | |
draft: true | |
prerelease: false | |
files: | | |
./dist/*.whl | |
./dist/*.tar.gz |