Skip to content

Commit f32a763

Browse files
authored
Merge branch 'main' into fix/deserialize-object
2 parents 28382f3 + c7b852d commit f32a763

File tree

8 files changed

+344
-121
lines changed

8 files changed

+344
-121
lines changed

.github/workflows/ci_cd.yml

+102-106
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@ on:
1111
branches:
1212
- main
1313

14+
env:
15+
MAIN_PYTHON_VERSION: '3.10'
16+
LIBRARY_NAME: 'ansys-openapi-common'
17+
1418
jobs:
1519
code-style:
1620
name: "Code style"
1721
runs-on: windows-latest
1822
steps:
1923
- uses: ansys/actions/code-style@v5
2024
with:
21-
python-version: "3.10"
25+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
2226
skip-install: "false"
2327

24-
docs-style:
28+
doc-style:
2529
name: Documentation Style Check
2630
runs-on: ubuntu-latest
2731
steps:
@@ -30,9 +34,81 @@ jobs:
3034
with:
3135
token: ${{ secrets.GITHUB_TOKEN }}
3236

33-
test:
37+
doc-build:
38+
name: Build Documentation
39+
runs-on: ubuntu-latest
40+
needs: doc-style
41+
42+
steps:
43+
- name: "Checkout the repository"
44+
uses: actions/checkout@v4
45+
46+
- name: "Set up Python"
47+
uses: actions/setup-python@v5
48+
with:
49+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
50+
51+
- name: "Install system dependencies"
52+
run: |
53+
sudo apt-get update && sudo apt-get install pandoc libkrb5-dev
54+
55+
- name: "Install Python dependencies"
56+
run: |
57+
python -m pip install --upgrade pip tox
58+
python -m pip install poetry~=1.7.0
59+
60+
- name: Install library
61+
run: |
62+
poetry install --with docs --extras "oidc linux-kerberos"
63+
64+
- name: Build HTML
65+
run: make -C doc html SPHINXOPTS="-W"
66+
67+
- name: Build PDF Documentation
68+
run: |
69+
sudo apt update
70+
sudo apt-get install -y texlive-latex-extra latexmk texlive-xetex fonts-freefont-otf xindy
71+
make -C doc latexpdf
72+
73+
- name: Upload HTML Documentation
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: documentation-html
77+
path: doc/build/html
78+
retention-days: 7
79+
80+
- name: Upload PDF Documentation
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: documentation-pdf
84+
path: doc/build/latex/*.pdf
85+
retention-days: 7
86+
87+
smoke-tests:
88+
name: "Build wheelhouse for latest Python versions"
89+
runs-on: ${{ matrix.os }}
90+
needs: code-style
91+
strategy:
92+
matrix:
93+
os: [ubuntu-latest, windows-latest]
94+
python-version: ['3.9', '3.10', '3.11', '3.12']
95+
steps:
96+
- name: Install kerberos headers
97+
if: matrix.os == 'ubuntu-latest'
98+
run: |
99+
sudo apt-get update
100+
sudo apt install libkrb5-dev
101+
102+
- uses: ansys/actions/build-wheelhouse@v5
103+
with:
104+
library-name: ${{ env.LIBRARY_NAME }}
105+
operating-system: ${{ matrix.os }}
106+
python-version: ${{ matrix.python-version }}
107+
108+
tests:
34109
name: Unit test on supported platforms
35110
runs-on: ubuntu-latest
111+
needs: smoke-tests
36112
services:
37113
# Label used to access the service container
38114
kdc-server:
@@ -83,97 +159,45 @@ jobs:
83159
fail_ci_if_error: true
84160
token: ${{ secrets.CODECOV_TOKEN }}
85161

86-
build:
87-
name: Build
162+
build-library:
163+
name: "Build library"
88164
runs-on: ubuntu-latest
89-
165+
needs: [ doc-build, tests ]
90166
steps:
91-
- uses: actions/checkout@v4
92-
- name: Setup Python
93-
uses: actions/setup-python@v5
94-
with:
95-
python-version: '3.10'
96-
97167
- name: Install kerberos headers
98168
run: |
99169
sudo apt-get update
100170
sudo apt install libkrb5-dev
101171
102-
- name: Create wheel
103-
run: |
104-
pip install poetry
105-
poetry build
106-
107-
- name: Validate wheel
108-
run: |
109-
pip install twine
110-
twine check dist/*
111-
112-
- name: Upload wheel
113-
uses: actions/upload-artifact@v4
172+
- uses: ansys/actions/build-library@v5
114173
with:
115-
name: ansys-grantami-common-wheel
116-
path: dist/
117-
retention-days: 7
174+
library-name: ${{ env.LIBRARY_NAME }}
175+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
118176

119-
docs:
120-
name: Build Documentation
177+
release:
178+
name: "Release"
179+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
180+
needs: [build-library]
121181
runs-on: ubuntu-latest
122-
123182
steps:
124-
- uses: actions/checkout@v4
125-
- name: Setup Python
126-
uses: actions/setup-python@v5
127-
with:
128-
python-version: '3.10'
129-
130-
- name: Install kerberos headers
131-
run: |
132-
sudo apt-get update
133-
sudo apt install libkrb5-dev
134-
135-
- name: Install library
136-
run: |
137-
pip install poetry
138-
poetry config installer.modern-installation false
139-
poetry install --with docs --extras "oidc linux-kerberos"
140-
141-
- name: Build HTML
142-
run: make -C doc html SPHINXOPTS="-W"
143-
144-
- name: Build PDF Documentation
145-
run: |
146-
sudo apt update
147-
sudo apt-get install -y texlive-latex-extra latexmk texlive-xetex fonts-freefont-otf xindy
148-
make -C doc latexpdf
149-
150-
- name: Upload HTML Documentation
151-
uses: actions/upload-artifact@v4
183+
- uses: ansys/actions/release-pypi-public@v5
184+
name: "Release to public PyPI"
152185
with:
153-
name: Documentation-html
154-
path: doc/build/html
155-
retention-days: 7
186+
library-name: ${{ env.LIBRARY_NAME }}
187+
twine-username: "__token__"
188+
twine-token: ${{ secrets.PYPI_TOKEN }}
156189

157-
- name: Upload PDF Documentation
158-
uses: actions/upload-artifact@v4
190+
- uses: ansys/actions/release-github@v5
191+
name: "Release to GitHub"
159192
with:
160-
name: Documentation-pdf
161-
path: doc/build/latex/*.pdf
162-
retention-days: 7
193+
library-name: ${{ env.LIBRARY_NAME }}
163194

164-
Release:
165-
if: contains(github.ref, 'refs/tags')
166-
needs: [build, test, code-style, docs]
195+
doc-deploy-stable:
196+
name: "Deploy stable documentation"
167197
runs-on: ubuntu-latest
198+
needs: release
199+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
168200
steps:
169-
- name: Set up Python
170-
uses: actions/setup-python@v5
171-
with:
172-
python-version: '3.10'
173-
174-
- uses: actions/checkout@v4
175-
176-
# used for documentation deployment
177201
- name: Get Bot Application Token
178202
id: get_workflow_token
179203
uses: peter-murray/workflow-application-token-action@v3
@@ -183,17 +207,7 @@ jobs:
183207

184208
- uses: actions/download-artifact@v4
185209
with:
186-
name: ansys-grantami-common-wheel
187-
path: ~/dist
188-
189-
- uses: actions/download-artifact@v4
190-
with:
191-
name: Documentation-pdf
192-
path: ~/pdf
193-
194-
- uses: actions/download-artifact@v4
195-
with:
196-
name: Documentation-html
210+
name: documentation-html
197211
path: ~/html
198212

199213
- name: Deploy
@@ -204,21 +218,3 @@ jobs:
204218
BRANCH: gh-pages
205219
FOLDER: ~/html
206220
CLEAN: true
207-
208-
# note how we use the PyPI tokens
209-
- name: Upload to PyPi
210-
run: |
211-
pip install twine
212-
twine upload --non-interactive --skip-existing ~/**/*.whl
213-
env:
214-
TWINE_USERNAME: __token__
215-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
216-
217-
- name: Release
218-
uses: softprops/action-gh-release@v1
219-
with:
220-
generate_release_notes: true
221-
files: |
222-
./**/*.whl
223-
./**/*.zip
224-
./**/*.pdf

AUTHORS.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This is the list of OpenAPI Common significant contributors.
2+
#
3+
# This file does not necessarily list everyone who has contributed code,
4+
# especially since many employees of one corporation may be contributing.
5+
# To see the full list of contributors, see the revision history in
6+
# source control.
7+
#
8+
# For contributions made under a Corporate CLA, then the copyright
9+
# belongs to that organization.
10+
#
11+
# If a contribution was made under an Individual CLA, the submitter
12+
# has indicated that they own the copyright. If that is your case, and
13+
# you want to be added to this file, please submit a request.
14+
#
15+
#
16+
ANSYS, Inc.

0 commit comments

Comments
 (0)