Skip to content

CI

CI #1893

Workflow file for this run

name: CI
on:
push:
branches: [master]
tags: [v*.*.*]
pull_request:
branches: [master]
pull_request_target:
branches: [master]
schedule:
- cron: 0 4 * * *
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
if: |
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') ||
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]')
steps:
- name: Checkout commit
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
- name: Cache packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-py-3.9-${{ hashFiles('requirements-test.txt') }}-${{
hashFiles('setup.py') }}
- name: Install dependencies
run: make setup
- name: Lint
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
make lint
env:
CI_LINT_RUN: 1
- name: Run unit tests
run: make test_unit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: .coverage.xml
name: codecov-unit
release:
name: Release
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout commit
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
- name: Install dependencies
run: |
python -m pip install . twine build
- name: Make dist
run: |
python -m build
- name: Upload package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_NON_INTERACTIVE: 1
run: |
twine upload dist/*