mirror of
https://github.com/ArcaneChat/arcanechat-tui.git
synced 2026-07-03 14:05:26 +02:00
57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master ]
|
|
tags:
|
|
- 'v*.*.*'
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.14"]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip setuptools
|
|
python -m pip install '.[dev]'
|
|
- name: Check code with black
|
|
run: |
|
|
black --check .
|
|
- name: Lint code with pylama
|
|
run: |
|
|
pylama
|
|
- name: Test with pytest
|
|
run: |
|
|
# pytest
|
|
|
|
deploy:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '3.x'
|
|
- id: check-tag
|
|
run: |
|
|
if [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
echo ::set-output name=match::true
|
|
fi
|
|
- name: Create PyPI release
|
|
uses: casperdcl/deploy-pypi@v2
|
|
with:
|
|
password: ${{ secrets.PYPI_TOKEN }}
|
|
build: true
|
|
# only upload if a tag is pushed (otherwise just build & check)
|
|
upload: ${{ github.event_name == 'push' && steps.check-tag.outputs.match == 'true' }}
|