try matrix config for build #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
generate-wrapper: | |
runs-on: "ubuntu-22.04" | |
defaults: | |
run: | |
working-directory: ./python-wrapper | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt -qy update && sudo apt -qy upgrade | |
sudo apt -qy install --no-install-recommends gcc g++ swig | |
- name: generate wrapper | |
run: ./generate_swig_wrapper.sh | |
shell: bash | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: python-sources | |
path: python-wrapper/sensirion_gas_index_algorithm/** | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: swig-sources | |
path: python-wrapper/swig/** | |
if-no-files-found: error | |
build: | |
strategy: | |
matrix: | |
py-version: [3.6, 3.8] | |
os: [ubuntu-22.04, windows-2019, macOS-15] | |
runs-on: "ubuntu-22.04" | |
needs: generate-wrapper | |
defaults: | |
run: | |
working-directory: ./python-wrapper | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: python-sources | |
path: python-wrapper/sensirion_gas_index_algorithm | |
- uses: actions/download-artifact@v4 | |
with: | |
name: swig-sources | |
path: python-wrapper/swig | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.py-version }} | |
- name: install package | |
run: | | |
pip3 install -e .[test] | |
pip3 install wheel | |
- name: static test | |
run: flake8 | |
- name: unit test | |
run: pytest | |
- name: create wheel | |
run: python3 setup.py bdist_wheel | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.py_version }}_${{ matrix.os}}_build | |
path: python-wrapper/dist/** | |
if-no-files-found: error | |
py3p8_linux_sdist: | |
runs-on: "ubuntu-22.04" | |
needs: generate-wrapper | |
defaults: | |
run: | |
working-directory: ./python-wrapper | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: python-sources | |
path: python-wrapper/sensirion_gas_index_algorithm | |
- uses: actions/download-artifact@v4 | |
with: | |
name: swig-sources | |
path: python-wrapper/swig | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: create dist package | |
run: python3 setup.py sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: source_dist | |
path: python-wrapper/dist/** | |
if-no-files-found: error |