Fix Max lookback issue #165
Workflow file for this run
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
# ----------------------- | |
# | |
# Run a full build-and-test from the git repo | |
# using a combination of conda and pip to install | |
# all optional dependencies. | |
# | |
# This is the 'full' test suite. | |
# | |
# ----------------------- | |
name: Build and test | |
on: | |
push: | |
branches: | |
- main | |
- master | |
- release/** | |
pull_request: | |
branches: | |
- main | |
- master | |
- release/** | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
conda: | |
name: Python ${{ matrix.python-version }} (${{ matrix.os }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- macOS | |
- Ubuntu | |
python-version: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
runs-on: ${{ matrix.os }}-latest | |
# this is needed for conda environments to activate automatically | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- name: Get source code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Cache conda packages | |
uses: actions/cache@v2 | |
env: | |
# increment to reset cache | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }} | |
restore-keys: ${{ runner.os }}-conda-${{ matrix.python-version }}- | |
- name: Configure conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: test | |
miniforge-variant: Mambaforge | |
python-version: ${{ matrix.python-version }} | |
use-mamba: true | |
- name: Conda info | |
run: conda info --all | |
- name: Install dependencies | |
run: | | |
# parse requirements to install as much as possible with conda | |
mamba create --name pip2conda pip2conda | |
mamba run --name pip2conda pip2conda \ | |
--all \ | |
--output environment.txt \ | |
--python-version ${{ matrix.python-version }} | |
echo "-----------------" | |
cat environment.txt | |
echo "-----------------" | |
mamba install --quiet --yes --name test --file environment.txt | |
- name: Install PyOmicron | |
run: python -m pip install --editable . --no-build-isolation -vv | |
- name: Package list | |
run: conda list --name test | |
- name: Run test suite | |
run: python -m pytest -ra --color yes --cov omicron --pyargs omicron --junitxml=pytest.xml | |
- name: Test command-line interfaces | |
run: | | |
python -m coverage run -a $(which omicron-show) --help | |
python -m coverage run -a $(which omicron-process) --help | |
python -m coverage run -a $(which omicron-status) --help | |
python -m coverage run -a $(which omicron-hdf5-merge) --help | |
python -m coverage run -a $(which omicron-root-merge) --help | |
- name: Coverage report | |
run: python -m coverage report --show-missing | |
- name: Prepare codecov upload | |
run: python -m coverage xml | |
- name: Publish coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: coverage.xml | |
flags: Conda,${{ runner.os }},python${{ matrix.python-version }} | |
- name: Upload test results | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pytest-conda-${{ matrix.os }}-${{ matrix.python-version }} | |
path: pytest.xml |