Skip to content

Feature/thumbnails #139

Feature/thumbnails

Feature/thumbnails #139

Workflow file for this run

name: Build
on:
# Run this workflow for pushes on all branches
push:
branches:
- '**'
# Run this workflow when a tag or branch is created
create:
# Run this workflow for pull requests
pull_request:
jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install 'poetry'
poetry install
- name: Run tests
run: |
poetry run coverage run -m pytest
poetry run coverage xml
- name: Generate and send coveralls report
uses: coverallsapp/github-action@v2
with:
parallel: true
finish:
runs-on: ubuntu-latest
needs: run_tests
steps:
- name: Close parallel build
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
publish_to_pypi:
# Only run this job if the run_tests job has succeeded, and if
# this workflow was triggered by the creation of a new tag
needs: run_tests
if: github.event_name == 'create' && github.event.ref_type == 'tag' && github.event.repository.fork == false
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install 'poetry'
- name: Build package and publish to PyPI
run: |
poetry build -f wheel
poetry build -f sdist
poetry publish -u "__token__" -p '${{ secrets.PYPI_OCS_ARCHIVE_API_TOKEN }}'