Skip to content

Restore running of astra tests (#568) #901

Restore running of astra tests (#568)

Restore running of astra tests (#568) #901

Workflow file for this run

# Install scico requirements and run short versions of example scripts
name: test examples
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allow this workflow to be run manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
name: test examples (ubuntu)
defaults:
run:
shell: bash -l {0}
steps:
# Check-out the repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v4
with:
submodules: recursive
# Set up conda environment
- name: Set up miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: test-env
python-version: "3.12"
# Configure conda environment cache
- name: Set up conda environment cache
uses: actions/cache@v4
with:
path: ${{ env.CONDA }}/envs
key: conda-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('dev_requirements.txt') }}-${{ hashFiles('examples/examples_requirements.txt') }}-${{ env.CACHE_NUMBER }}
env:
CACHE_NUMBER: 0 # Increase this value to force cache reset
id: cache
# Display environment details
- name: Display environment details
run: |
conda info
printenv | sort
# Install required system package
- name: Install required system package
run: sudo apt-get install -y libopenblas-dev
# Install dependencies in conda environment
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
conda install -c conda-forge pytest pytest-cov
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev_requirements.txt
conda install -c conda-forge astra-toolbox
conda install -c conda-forge pyyaml
pip install --upgrade --force-reinstall scipy>=1.6.0 # Temporary fix for GLIBCXX_3.4.30 not found in conda forge version
pip install -r examples/examples_requirements.txt
# Install package to be tested
- name: Install package to be tested
run: pip install -e .
# Run example test
- name: Run example test
run: |
${GITHUB_WORKSPACE}/examples/scriptcheck.sh -e -d -t -g