Skip to content

Commit

Permalink
add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Oct 16, 2023
1 parent 969bb6a commit e789885
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 2 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
push:
branches: [ master ]
tags:
- 'v*.*.*'
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.11']
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
python -m pip install '.[dev]'
- name: Check code with black
run: |
black --check .
- name: Lint code
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' }}
- name: Create GitHub release
if: ${{ github.event_name == 'push' && steps.check-tag.outputs.match == 'true' }}
uses: Roang-zero1/github-create-release-action@master
with:
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ dynamic = [
"version"
]
dependencies = [
"deltachat-rpc-client",
"deltachat-rpc-client>=1.125.0",
"appdirs>=1.4.4",
"rich>=12.6.0",
"qrcode",
"qrcode>=7.4.2",
]

[project.optional-dependencies]
Expand All @@ -37,6 +37,9 @@ dev = [
"pylama",
"pytest",
]
server = [
"deltachat-rpc-server>=1.125.0",
]

[tool.black]
line-length = 120
Expand Down

0 comments on commit e789885

Please sign in to comment.