Skip to content

Workflow concurrency #281

Workflow concurrency

Workflow concurrency #281

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python application
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
python-version: ['3.10', '3.12']
exclude:
- os: macos-14
python-version: '3.10'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up environment variable (macOS)
if: ${{ startsWith(matrix.os, 'macos-') }}
run: |
echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ startsWith(matrix.os, 'macos-') && 'ARM64' || 'x64' }}
- name: Install FFTW3 (Ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install -y libfftw3-bin libfftw3-dev
- name: Install FFTW3 and libomp (macOS)
if: ${{ startsWith(matrix.os, 'macos-') }}
run: |
brew install fftw
brew install libomp
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
# to ensure installation order
pip install -r requirements.txt
- name: Setup casconfig environment
run: |
mkdir -p ~/.casa/data
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 python --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 python --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build PRIISM
run: python3 setup.py build
- name: Install PRIISM
run: python3 setup.py install
- name: Check if libmfista library is created
run: |
PRIISM_INSTALL_DIR=$(python3 -c 'import os, sys, priism; print(os.path.dirname(priism.__file__))' | grep -E "^/.*/python3.*/priism")
ls -l $PRIISM_INSTALL_DIR/core/libmfista_nufft.so
- name: Test with pytest
run: |
pip install pytest
pytest tests/test_util.py