-
Notifications
You must be signed in to change notification settings - Fork 37
65 lines (58 loc) · 1.73 KB
/
test-and-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: "Test & Release"
on:
push:
branches: [ "1.x" ]
tags: [ "1.*" ]
pull_request:
branches: [ "1.x" ]
env:
FORCE_COLOR: 1
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- container: python:2
tox-envs: "sqla06-py27,sqla07-py27,sqla08-py27,sqla09-py27,sqlalchemy-py27"
- container: python:3
tox-envs: "sqlalchemy-py3"
steps:
- uses: "actions/checkout@v4"
- name: "Install graphviz"
run: |
sudo apt-get update
sudo apt-get -y install graphviz
- name: "Install tox flake8"
run: |
python -m pip install tox flake8
- name: "Lint with flake8"
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: "Test with tox"
run: |
tox -v -e ${{ matrix.tox-envs }} -- -v --color=yes
release:
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')"
runs-on: "ubuntu-latest"
needs: "test"
steps:
- uses: "actions/checkout@v4"
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install build
- name: "Build"
run: |
python -m build
git status --ignored
- name: "Publish"
uses: "pypa/gh-action-pypi-publish@release/v1"
with:
user: "__token__"
password: "${{ secrets.TEST_PYPI_API_TOKEN }}"
repository_url: "https://test.pypi.org/legacy/"