92 lines (78 loc) · 2.73 KB
/
test_windows.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
name: Windows
on:
push:
branches:
- '**'
paths-ignore:
- docs/**
- ChangeLog*
- .github/workflows/test_macos.yml
- .github/workflows/test_linux.yml
- .github/workflows/test_linux_aarch64.yml
- dev/build_manylinux_wheels.sh
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
pull_request:
branches:
- '**'
paths-ignore:
- docs/**
- ChangeLog*
- .github/workflows/test_macos.yml
- .github/workflows/test_linux.yml
- .github/workflows/test_linux_aarch64.yml
- dev/build_manylinux_wheels.sh
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
os: [windows-latest]
python-architecture: [x86, x64]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture}}
- name: Install OpenSSL x86
if: matrix.python-architecture == 'x86'
run: choco install openssl --forcex86 --version=1.1.1.2100
- name: Install OpenSSL x64
if: matrix.python-architecture == 'x64'
run: choco install openssl --version=3.1.1
- name: Install & build dependencies
run: |
choco install gperf
python -m pip install --upgrade pip
pip install -r dev/requirements-dev.txt
python dev/build.py --ws-dir=freetds --dist-dir=dist --sdist
pip install pymssql --no-index -f dist
python -c "import pymssql; print(pymssql.version_info())"
- name: Test with pytest
run: |
pip install twine --upgrade
twine check dist/*
pytest -sv --durations=0
- name: Archive wheels and sdist
uses: actions/upload-artifact@v4
with:
name: pymssql-${{ matrix.runs-on }}-${{ matrix.python-architecture }}-${{ github.sha }}
path: dist
overwrite: true
- name: Publish wheels
if: github.repository_owner == 'pymssql' && startsWith(github.ref, 'refs/tags/v')
run: |
pip install twine --upgrade
twine upload --skip-existing -u __token__ -p ${{secrets.PYMSSQL_PYPI_TOKEN}} dist/*.whl
- name: Publish wheels on test.pypi.org
if: github.repository_owner == 'pymssql' && github.ref == 'refs/heads/master'
run: |
pip install twine --upgrade
twine upload --skip-existing -u __token__ -p ${{secrets.PYMSSQL_TEST_PYPI_TOKEN}} --repository-url=https://test.pypi.org/legacy/ dist/*.whl