Rename variables and fix unit tests #44
This file contains hidden or 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: mvesuvio pull request workflow | |
on: push | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Set up conda environnment | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: latest | |
activate-environment: vesuvio-dev | |
environment-file: vesuvio-dev.yml | |
auto-activate-base: false | |
- name: Install Mantid | |
run: | | |
mamba install -c mantid/label/nightly mantidworkbench | |
- name: Install Git | |
run: mamba install -y git | |
- name: Install mvesuvio package | |
run: pip install . | |
- name: Check for analysis files changed | |
run: | | |
echo "analysis-changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q -e '^src/' -e '^tests/' && echo true || echo false)" >> $GITHUB_ENV | |
- name: Check for calibration files changed | |
run: | | |
echo "calibration-changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q -e '^tools/calibration_scripts/' -e '^tests/' && echo true || echo false)" >> $GITHUB_ENV | |
- name: Check if first workflow to run on PR | |
run: | | |
# Check if the base commit (before the PR) exists in the history | |
if ! git merge-base --is-ancestor ${{ github.event.pull_request.base.sha }} HEAD; then | |
echo "First push detected (or force push), running all tests." | |
echo "analysis-changed=true" >> $GITHUB_ENV | |
echo "calibration-changed=true" >> $GITHUB_ENV | |
fi | |
- name: Run mvesuvio Analysis Unit Tests | |
if: ${{ env.analysis-changed == 'true'}} | |
run: | | |
python -m unittest discover -s ./tests/unit/analysis | |
- name: Run mvesuvio Analysis System Tests | |
if: ${{ env.analysis-changed == 'true'}} | |
run: | | |
python -m unittest discover -s ./tests/system/analysis | |
- name: Run mvesuvio Calibration Unit Tests | |
if: ${{ env.calibration-changed == 'true'}} | |
run: | | |
python -m unittest discover -s ./tests/unit/calibration | |
- name: Run Vesuvio Calibration System Tests | |
if: ${{ env.calibration-changed == 'true'}} | |
run: | | |
python -m unittest discover -s ./tests/system/calibration |