-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (57 loc) · 1.71 KB
/
build-release.yaml
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
name: build
on:
push:
branches: ["master"]
tags: ["*"]
pull_request:
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- run: python -m pip install --upgrade pip wheel
- run: pip install tox
- run: tox -elint
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- {name: '3.9', python: '3.9', tox: py39}
- {name: '3.10', python: '3.10', tox: py310}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- run:
sudo sh -c "echo 'deb https://packagecloud.io/timescale/timescaledb/ubuntu/
`lsb_release -c -s` main' > /etc/apt/sources.list.d/timescaledb.list"
- run:
wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey |
sudo apt-key add -
- run: sudo apt-get update
- run: sudo apt-get install timescaledb-2-postgresql-14
- name: Run test
run: |
python -m pip install --upgrade pip wheel
pip install tox
tox -e${{ matrix.tox }}
- name: Upload coverage
uses: codecov/codecov-action@v3
release:
needs: [lint, tests]
name: PyPI release
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- run: python -m pip install --upgrade pip wheel
- run: pip install twine
- run: python setup.py sdist bdist_wheel
- run: twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/*