-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (78 loc) · 2.04 KB
/
ci.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version:
- "3.11"
- "3.12"
steps:
- name: Checkout the source
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
setup.cfg
- name: Install dependencies
run: |
docker pull redis:7-alpine
python -m pip install -U pip setuptools
python -m pip install -U -e '.[test]'
- name: Build the proxy
run: |
cd src/qedis-proxy
go build
- name: Test with pytest
timeout-minutes: 30
run: |
python -m pytest -v --cov=src tests
- name: Send code coverage report
uses: codecov/codecov-action@v3
with:
env_vars: GHA_OS,GHA_PYTHON
required-checks:
if: always()
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
deploy-to-pypi:
needs: [test]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
environment: deploy-to-pypi-qedis
permissions:
id-token: write
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: |
setup.cfg
- name: Install dependencies
run: |
python -m pip install -U pip setuptools
pip install -U -e '.[build]'
- name: Build sdist and wheel
run: |
python -m build -s -w
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1