-
Notifications
You must be signed in to change notification settings - Fork 1k
131 lines (114 loc) · 3.83 KB
/
main.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Main Workflow
on:
push:
branches:
- develop2
- release/*
- '*'
pull_request:
branches:
- '*'
- 'release/*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
set_python_versions:
runs-on: ubuntu-latest
outputs:
python_versions_linux_windows: ${{ steps.set_versions.outputs.python_versions_linux_windows }}
python_versions_macos: ${{ steps.set_versions.outputs.python_versions_macos }}
name: Determine Python versions
steps:
- name: Determine Python versions
id: set_versions
run: |
if [[ "${{ github.ref }}" == "refs/heads/develop2" || "${{ github.ref }}" == refs/heads/release/* ]]; then
echo "python_versions_linux_windows=['3.13', '3.6']" >> $GITHUB_OUTPUT
echo "python_versions_macos=['3.13', '3.8']" >> $GITHUB_OUTPUT
else
echo "python_versions_linux_windows=['3.10']" >> $GITHUB_OUTPUT
echo "python_versions_macos=['3.10']" >> $GITHUB_OUTPUT
fi
linux_suite:
needs: set_python_versions
uses: ./.github/workflows/linux-tests.yml
name: Linux test suite
with:
python-versions: ${{ needs.set_python_versions.outputs.python_versions_linux_windows }}
osx_suite:
needs: set_python_versions
uses: ./.github/workflows/osx-tests.yml
name: OSX test suite
with:
python-versions: ${{ needs.set_python_versions.outputs.python_versions_macos }}
windows_suite:
needs: set_python_versions
uses: ./.github/workflows/win-tests.yml
name: Windows test suite
with:
python-versions: ${{ needs.set_python_versions.outputs.python_versions_linux_windows }}
code_coverage:
runs-on: ubuntu-latest
name: Code coverage
if: github.ref == 'refs/heads/develop2' # Only measure code coverage on main branch
needs: [linux_suite, osx_suite, windows_suite]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Merge coverage reports
run: |
pip install coverage
coverage combine
coverage report
coverage xml
- name: Code coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: geekyeggo/delete-artifact@v5
with:
name: |
.coverage.*
deploy_to_pypi_test:
runs-on: ubuntu-latest
name: Deploy to TestPyPI
if: github.ref == 'refs/heads/develop2'
needs: [linux_suite, osx_suite, windows_suite]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install --upgrade pip
pip install twine
- name: Bump Dev Version
run: |
python .ci/bump_dev_version.py
- name: Build Package
run: |
python setup.py sdist
- name: Upload to TestPyPI
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
run: |
python -m twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/*
- name: Deploy conan-server to TestPyPI
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_SERVER_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_SERVER_PASSWORD }}
run: |
rm -rf dist/
mv setup_server.py setup.py
python setup.py sdist
python -m twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/*