Skip to content

limit to python>=3.8 and add test for apple silicon #38

limit to python>=3.8 and add test for apple silicon

limit to python>=3.8 and add test for apple silicon #38

Workflow file for this run

name: Install and Test Package
on:
push:
branches:
- main
release:
types: [created]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
#macoos-13 is x86_64 (Intel-based), macos-14 is ARM64
os: [ubuntu-latest, macos-13, macos-14]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
miniconda-version: "latest"
auto-activate-base: true
- name: Install mamba for faster environment setup
run: conda install -n base -c conda-forge mamba
- name: Cache Conda Environment
id: cache-conda
uses: actions/cache@v3
with:
path: /Users/runner/miniconda3/envs/ql
key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles('environment.yml') }}
restore-keys: |
${{ runner.os }}-conda-${{ matrix.python-version }}-
- name: Remove existing Conda environment if cache not hit
if: steps.cache-conda.outputs.cache-hit != 'true'
run: conda env remove -n ql || echo "Environment does not exist"
- name: Create Conda environment using mamba
if: steps.cache-conda.outputs.cache-hit != 'true'
run: mamba env create -f environment.yml
- name: Install pip dependencies
shell: bash -l {0}
run: |
conda activate ql
pip install -r requirements.txt
- name: Install the package in editable mode
shell: bash -l {0}
run: |
conda activate ql
pip install -e .
- name: Test with pytest
shell: bash -l {0}
run: |
conda activate ql
pytest
### quicklook name is taken in pypi
# publish:
# needs: build
# runs-on: ubuntu-latest
# if: github.event_name == 'release' && github.event.action == 'created'
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install build twine
# - name: Build package
# run: python -m build
# - name: Publish to PyPI
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
# run: twine upload dist/*