Cycle 23/3 fixes and new features for 23/4 #31
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
name: Direct reduction unit tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
types: [opened, reopened, synchronize] | |
release: | |
types: [published] | |
schedule: | |
- cron: '1 1 * * 1' | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
#- name: Cache mamba | |
# uses: actions/cache@v3 | |
# env: | |
# CACHE_NUMBER: 0 | |
# with: | |
# path: ~/conda_pkgs_dir | |
# key: mamba-${{ hashFiles('environment.yml') }} | |
- name: Setup Miniconda | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
miniforge-version: latest | |
environment-file: environment.yml | |
create-args: >- | |
python=3.10 | |
- name: Cache data and instrument files | |
id: cache-files | |
uses: actions/cache@v3 | |
with: | |
path: | | |
InstrumentFiles | |
datafiles | |
key: cached-data-${{ hashFiles('**/cached_git_hashes') }} | |
- name: Install Mantid | |
run: | | |
mamba install -c mantid/label/nightly mantid | |
- name: Clone data instrument files | |
if: ${{ steps.cache-files.outputs.cache-hit != 'true' }} | |
run: | | |
git clone https://github.com/pace-neutrons/InstrumentFiles.git | |
git clone https://github.com/mducle/direct_reduction_test.git | |
cp -rpa direct_reduction_test/datafiles ./ | |
- name: Update data instrument files | |
run: | | |
cwd=$(pwd) | |
cd $cwd/InstrumentFiles && git pull && git rev-parse --short HEAD > ../datafiles/cached_git_hashes | |
cd $cwd/direct_reduction_test && git pull && git rev-parse --short HEAD >> cached_git_hashes | |
cd $cwd && rsync -av direct_reduction_test/datafiles/ datafiles/ | |
- name: Run Tests and Coverage | |
run: | | |
cd tests | |
coverage run --source=.. run_test.py | |
- name: Report Coverage | |
run: | | |
cd tests | |
coverage report | |
#- name: Setup tmate | |
# if: ${{ failure() }} | |
# uses: mxschmitt/action-tmate@v3 |