1+ on :
2+ push :
3+ pull_request :
4+ branches :
5+ - master
6+
7+ jobs :
8+ generate-wrapper :
9+ runs-on : " ubuntu-22.04"
10+ defaults :
11+ run :
12+ working-directory : ./python-wrapper
13+ steps :
14+ - uses : actions/checkout@v4
15+ - name : Install dependencies
16+ run : |
17+ sudo apt -qy update && sudo apt -qy upgrade
18+ sudo apt -qy install --no-install-recommends gcc g++ swig
19+ - name : generate wrapper
20+ run : ./generate_swig_wrapper.sh
21+ shell : bash
22+ - uses : actions/upload-artifact@v4
23+ with :
24+ name : python-sources
25+ path : python-wrapper/sensirion_gas_index_algorithm/**
26+ if-no-files-found : error
27+ - uses : actions/upload-artifact@v4
28+ with :
29+ name : swig-sources
30+ path : python-wrapper/swig/**
31+ if-no-files-found : error
32+ check_readme_rst_syntax :
33+ runs-on : " ubuntu-22.04"
34+ defaults :
35+ run :
36+ working-directory : ./python-wrapper
37+ steps :
38+ - uses : actions/checkout@v4
39+ - uses : actions/setup-python@v5
40+ with :
41+ python-version : 3.8
42+ - name : install rst linter
43+ run : pip install restructuredtext-lint pygments
44+ - name : run
45+ run : rst-lint *.rst
46+ build :
47+ continue-on-error : true
48+ strategy :
49+ matrix :
50+ py-version : ["3.8", "3.9"]
51+ os : [ubuntu-22.04, windows-2019, macOS-15]
52+ fail-fast : false
53+ runs-on : " ubuntu-22.04"
54+ needs : generate-wrapper
55+ defaults :
56+ run :
57+ working-directory : ./python-wrapper
58+ steps :
59+ - uses : actions/checkout@v4
60+ - uses : actions/download-artifact@v4
61+ with :
62+ name : python-sources
63+ path : python-wrapper/sensirion_gas_index_algorithm
64+ - uses : actions/download-artifact@v4
65+ with :
66+ name : swig-sources
67+ path : python-wrapper/swig
68+ - uses : actions/setup-python@v5
69+ with :
70+ python-version : ${{ matrix.py-version }}
71+ - name : install package
72+ run : |
73+ pip3 install -e .[test]
74+ pip3 install wheel
75+ - name : static test
76+ run : flake8
77+ - name : unit test
78+ run : pytest
79+ - name : create wheel
80+ run : python3 setup.py bdist_wheel
81+ - uses : actions/upload-artifact@v4
82+ with :
83+ name : py_${{ matrix.py-version }}_${{ matrix.os}}_build
84+ path : python-wrapper/dist/**
85+ if-no-files-found : error
86+ py3p8_linux_sdist :
87+ runs-on : " ubuntu-22.04"
88+ needs : generate-wrapper
89+ defaults :
90+ run :
91+ working-directory : ./python-wrapper
92+ steps :
93+ - uses : actions/checkout@v4
94+ - uses : actions/download-artifact@v4
95+ with :
96+ name : python-sources
97+ path : python-wrapper/sensirion_gas_index_algorithm
98+ - uses : actions/download-artifact@v4
99+ with :
100+ name : swig-sources
101+ path : python-wrapper/swig
102+ - uses : actions/setup-python@v5
103+ with :
104+ python-version : 3.8
105+ - name : create dist package
106+ run : python3 setup.py sdist
107+ - uses : actions/upload-artifact@v4
108+ with :
109+ name : source_dist
110+ path : python-wrapper/dist/**
111+ if-no-files-found : error
112+ build_pages :
113+ runs-on : " ubuntu-22.04"
114+ needs : generate-wrapper
115+ defaults :
116+ run :
117+ working-directory : ./python-wrapper
118+ steps :
119+ - uses : actions/checkout@v4
120+ - uses : actions/download-artifact@v4
121+ with :
122+ name : python-sources
123+ path : python-wrapper/sensirion_gas_index_algorithm
124+ - uses : actions/download-artifact@v4
125+ with :
126+ name : swig-sources
127+ path : python-wrapper/swig
128+ - uses : actions/setup-python@v5
129+ with :
130+ python-version : 3.8
131+ cache : " pip"
132+ - name : Install the project dependencies
133+ run : |
134+ python setup.py install
135+ python -m pip install -r docs/requirements.txt
136+ - name : Build documentation
137+ run : cd ./docs && make html
138+ - name : Upload html
139+ uses : actions/upload-pages-artifact@v1
140+ with :
141+ path : python-wraper/docs/_build/html
142+ deploy_pages :
143+ runs-on : " ubuntu-22.04"
144+ needs : build_pages
145+ permissions :
146+ pages : write # to deploy to Pages
147+ id-token : write # to verify the deployment originates from an appropriate source
148+ # Deploy to the github-pages environment
149+ environment :
150+ name : github-pages
151+ url : ${{ steps.deployment.outputs.page_url }}
152+ steps :
153+ - name : Deploy to GitHub Pages
154+ id : deployment
155+ uses : actions/deploy-pages@v2
156+ with :
157+ token : ${{secrets.GITHUB_TOKEN}}
158+
159+
0 commit comments