build-and-test #253
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
name: build-and-test | |
on: | |
push: | |
branches: [ '**' ] | |
pull_request: | |
branches: [ '**' ] | |
schedule: | |
# At 23:25 on Thursday. | |
- cron: "25 23 * * 4" | |
workflow_dispatch: | |
jobs: | |
# Build on all platforms | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, ubuntu-latest, macos-13, macos-latest, windows-2019, windows-latest] | |
python-version: [ '3.9', '3.x' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install libhdf5 (macOS) | |
# See https://stackoverflow.com/questions/73029883 | |
if: runner.os == 'macOS' | |
run: | | |
brew install hdf5 | |
brew install c-blosc | |
export HDF5_DIR=/opt/homebrew/opt/hdf5 | |
export BLOSC_DIR=/opt/homebrew/opt/c-blosc | |
export LZO_DIR=/opt/homebrew/opt/lzo | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Build and install flydra_core | |
run: python -m pip install ./flydra_core | |
- name: Install libcairo2-dev (Ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get install -y libcairo2-dev | |
- name: Build and install flydra_analysis | |
run: python -m pip install ./flydra_analysis | |
# Test on Ubuntu with system python | |
test-ubuntu-system-python: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update package index | |
run: sudo apt-get update | |
- name: Install system packages | |
run: sudo apt-get install -y libcairo2-dev octave | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Build and install flydra_core | |
run: | | |
cd flydra_core | |
python -m pip install -e . | |
- name: Test flydra_core | |
run: | | |
python -m pip install pytest | |
cd flydra_core | |
pytest | |
- name: Build and install flydra_analysis | |
run: | | |
cd flydra_analysis | |
python -m pip install -e . | |
- name: Test flydra_analysis | |
run: | | |
python -m pip install pytest | |
cd flydra_analysis | |
pytest |