Skip to content

Update pypi_token in python-publish.yml #28

Update pypi_token in python-publish.yml

Update pypi_token in python-publish.yml #28

Workflow file for this run

# Run this job on pushes to `main`, and for pull requests. If you don't specify
# `branches: [main], then this actions runs _twice_ on pull requests, which is
# annoying.
on:
push:
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3.5.3
# If you wanted to use multiple Python versions, you'd have specify a matrix in the job and
# reference the matrixe python version here.
- name: Set up Python 3.8
uses: actions/setup-python@v3.1.4
with:
python-version: 3.8
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow
# from installing Poetry every time, which can be slow. Note the use of the Poetry version
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache
# manually if/when you want to upgrade Poetry, or if something goes wrong. This could be
# mildly cleaner by using an environment variable, but I don't really care.
- name: cache poetry install
uses: actions/cache@v3.3.1
with:
path: ~/.local
key: poetry-1.1.12-0
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.2.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: cache deps
id: cache-deps
uses: actions/cache@v3.3.1
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
- run: poetry install --no-interaction --no-root --with=dev
if: steps.cache-deps.outputs.cache-hit != 'true'
# - name: Install project
# run: poetry install --no-interaction
# And finally run tests. I'm using pytest and all my pytest config is in my `pyproject.toml`
# so this line is super-simple. But it could be as complex as you need.
- name: Run tests with coverage
run: poetry run pytest --cov=sqlalchemy_crud --cov-report=xml:coverage.xml --junitxml=test-report.xml ./tests
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage artifact
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage.xml