| 1 |
name: Test pyspnego |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: |
| 5 |
- main |
| 6 |
paths-ignore: |
| 7 |
- CHANGELOG.md |
| 8 |
- LICENSE |
| 9 |
- README.md |
| 10 |
|
| 11 |
pull_request: |
| 12 |
branches: |
| 13 |
- main |
| 14 |
paths-ignore: |
| 15 |
- CHANGELOG.md |
| 16 |
- LICENSE |
| 17 |
- README.md |
| 18 |
|
| 19 |
release: |
| 20 |
types: |
| 21 |
- published |
| 22 |
|
| 23 |
schedule: |
| 24 |
- cron: 0 9 * * * |
| 25 |
|
| 26 |
jobs: |
| 27 |
build: |
| 28 |
name: build sdist and universal wheel |
| 29 |
runs-on: ubuntu-latest |
| 30 |
steps: |
| 31 |
- uses: actions/checkout@v3 |
| 32 |
|
| 33 |
- name: build sdist and universal wheel |
| 34 |
run: | |
| 35 |
python -m pip install build |
| 36 |
python -m build |
| 37 |
|
| 38 |
- uses: actions/upload-artifact@v3 |
| 39 |
with: |
| 40 |
name: artifact |
| 41 |
path: ./dist/* |
| 42 |
|
| 43 |
test: |
| 44 |
name: test |
| 45 |
needs: |
| 46 |
- build |
| 47 |
|
| 48 |
runs-on: ${{ matrix.os }} |
| 49 |
strategy: |
| 50 |
fail-fast: false |
| 51 |
matrix: |
| 52 |
os: |
| 53 |
- ubuntu-latest |
| 54 |
- macOS-12 |
| 55 |
- windows-latest |
| 56 |
python-version: |
| 57 |
- 3.8 |
| 58 |
- 3.9 |
| 59 |
- '3.10' |
| 60 |
- '3.11' |
| 61 |
- '3.12' |
| 62 |
python-arch: |
| 63 |
- x86 |
| 64 |
- x64 |
| 65 |
gssapi-provider: |
| 66 |
- mit |
| 67 |
- heimdal |
| 68 |
- sspi |
| 69 |
|
| 70 |
exclude: |
| 71 |
- os: ubuntu-latest |
| 72 |
python-arch: x86 |
| 73 |
- os: ubuntu-latest |
| 74 |
gssapi-provider: sspi |
| 75 |
|
| 76 |
- os: macOS-12 |
| 77 |
python-arch: x86 |
| 78 |
- os: macOS-12 |
| 79 |
gssapi-provider: mit |
| 80 |
- os: macOS-12 |
| 81 |
gssapi-provider: sspi |
| 82 |
|
| 83 |
- os: windows-latest |
| 84 |
gssapi-provider: mit |
| 85 |
- os: windows-latest |
| 86 |
gssapi-provider: heimdal |
| 87 |
|
| 88 |
steps: |
| 89 |
- uses: actions/checkout@v3 |
| 90 |
|
| 91 |
- uses: actions/setup-python@v4 |
| 92 |
with: |
| 93 |
python-version: ${{ matrix.python-version }} |
| 94 |
architecture: ${{ matrix.python-arch }} |
| 95 |
|
| 96 |
- uses: actions/download-artifact@v3 |
| 97 |
with: |
| 98 |
name: artifact |
| 99 |
path: ./dist |
| 100 |
|
| 101 |
- name: Extract OS name |
| 102 |
shell: bash |
| 103 |
run: | |
| 104 |
echo NAME=$( echo '${{ matrix.os }}' | tr '-' ' ' | awk '{print $1}' ) |
| 105 |
echo "name=${NAME}" >> $GITHUB_OUTPUT |
| 106 |
id: os |
| 107 |
|
| 108 |
- name: Test |
| 109 |
shell: bash |
| 110 |
run: | |
| 111 |
if [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then |
| 112 |
build_helpers/run-ci.sh |
| 113 |
else |
| 114 |
sudo -E build_helpers/run-ci.sh |
| 115 |
fi |
| 116 |
env: |
| 117 |
GSSAPI_PROVIDER: ${{ matrix.gssapi-provider }} |
| 118 |
PYTEST_ADDOPTS: --color=yes |
| 119 |
|
| 120 |
- name: Upload Test Results |
| 121 |
if: always() |
| 122 |
uses: actions/upload-artifact@v3 |
| 123 |
with: |
| 124 |
name: Unit Test Results (${{ matrix.os }} ${{ matrix.python-version }} ${{ matrix.python-arch }}) |
| 125 |
path: ./junit/test-results.xml |
| 126 |
|
| 127 |
- name: Upload Coverage Results |
| 128 |
if: always() |
| 129 |
uses: actions/upload-artifact@v3 |
| 130 |
with: |
| 131 |
name: Coverage Results (${{ matrix.os }} ${{ matrix.python-version }} ${{ matrix.python-arch }}) |
| 132 |
path: ./coverage.xml |
| 133 |
|
| 134 |
- name: Upload Coverage to codecov |
| 135 |
if: always() |
| 136 |
uses: codecov/codecov-action@v3 |
| 137 |
with: |
| 138 |
files: ./coverage.xml |
| 139 |
flags: ${{ steps.os.outputs.name }},py${{ matrix.python-version }},${{ matrix.python-arch }} |
| 140 |
|
| 141 |
publish: |
| 142 |
name: publish |
| 143 |
needs: |
| 144 |
- test |
| 145 |
runs-on: ubuntu-latest |
| 146 |
permissions: |
| 147 |
# IMPORTANT: this permission is mandatory for trusted publishing |
| 148 |
id-token: write |
| 149 |
|
| 150 |
steps: |
| 151 |
- uses: actions/download-artifact@v3 |
| 152 |
with: |
| 153 |
name: artifact |
| 154 |
path: ./dist |
| 155 |
|
| 156 |
- name: Publish package to PyPI |
| 157 |
if: startsWith(github.ref, 'refs/tags/v') |
| 158 |
uses: pypa/gh-action-pypi-publish@release/v1 |