Skip to content

Use setup_lfs action in compare refdata pipeline #64

Use setup_lfs action in compare refdata pipeline

Use setup_lfs action in compare refdata pipeline #64

Workflow file for this run

name: compare-refdata
on:
repository_dispatch:
types: [compare-refdata-command]
workflow_dispatch:
workflow_call: # to be called by pre release workflow
pull_request:
branches:
- '*'
env:
PYTEST_FLAGS_COMPARE: --tardis-refdata=${{ github.workspace }}/tardis-refdata --tardis-regression-data=${{ github.workspace }}/tardis-regression-data --generate-reference
REF2_HASH: origin/master
defaults:
run:
shell: bash -l {0}
jobs:
build:
if: github.repository_owner == 'tardis-sn'
runs-on: ubuntu-latest
steps:
- name: Setup LFS
uses: tardis-sn/tardis/.github/actions/setup_lfs@master
- name: Checkout TARDIS (master)
uses: actions/checkout@v4
if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'schedule') }} # for checking master
with:
repository: tardis-sn/tardis
path: tardis/
- name: Checkout TARDIS (PR)
uses: actions/checkout@v4
if: ${{ (github.event_name == 'repository_dispatch') }} # for checking PRs
with:
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
path: tardis/
ref: ${{ github.event.client_payload.pull_request.head.ref }}
- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: tardis
use-mamba: true
- name: Update environment
working-directory: tardis/
run: mamba update -n tardis --file conda-linux-64.lock
- name: Install Bokeh
run: mamba install bokeh --channel conda-forge --no-update-deps --yes
- name: Generate reference data for comparison
working-directory: tardis/
run: pytest tardis ${{ env.PYTEST_FLAGS_COMPARE }}
- name: Compare Reference Data
working-directory: tardis-refdata/notebooks/
run: |
jupyter nbconvert ref_data_compare.ipynb --to html --allow-errors --execute --ExecutePreprocessor.timeout=6000
- name: Upload comparison notebook
uses: actions/upload-artifact@v2
with:
name: Comparison Notebook
path: tardis-refdata/notebooks/ref_data_compare.html
- name: Check if reference data are equal
run: if [ "$(cat ../refdata_compare_result)" == "REFDATA COMPARISON FAILED" ]; then exit 1; fi