Skip to content

CI

CI #693

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
tags:
- '*'
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
build_wheel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.8, 3.9, "3.10", "3.11"]
steps:
- name: Checkout github repo
uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Create Wheel
run: |
pip install build
python -m build
mkdir wheelhouse
cp dist/spyrit-* wheelhouse/
ls wheelhouse
rm -r dist
mv wheelhouse dist
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.python-version }}
path: dist/
test_install:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
python-version: [3.8, 3.9, "3.10", "3.11"]
steps:
- name: Checkout github repo
uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Run the tests on Mac and Linux
if: matrix.os != 'windows-latest'
run: |
pip install -e .
python spyrit/test/run_tests.py
- name: Run the tests on Windows
if: matrix.os == 'windows-latest'
run: |
pip install -e .
python spyrit\test\run_tests.py
test_wheel:
runs-on: ${{ matrix.os }}
needs: [build_wheel]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
python-version: [3.8, 3.9, "3.10", "3.11"]
steps:
- name: Checkout github repo
uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
path: dist/
- name: Run tests on Mac and Linux
if: matrix.os != 'windows-latest'
run: |
cd dist
pip install spyrit-*.whl
cd ..
python spyrit/test/run_tests.py
- name: Run the tests on Windows
if: matrix.os == 'windows-latest'
run: |
cd dist
$package=dir -Path . -Filter spyrit*.whl | %{$_.FullName}
echo $package
pip install $package
cd ..
python spyrit\test\run_tests.py
publish_wheel:
runs-on: ubuntu-latest
needs: [build_wheel, test_wheel, test_install]
steps:
- name: Checkout github repo
uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive
- uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
path: dist/
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI }}
skip_existing: true