Skip to content

Commit

Permalink
Compare Refdata Pipeline Fixes (#75)
Browse files Browse the repository at this point in the history
* Add regression data, PR checkout fixes

* Call compare refdata using pre release workflow

* remove cron job because it runs on pre release pipeline
  • Loading branch information
atharva-2001 authored Mar 25, 2024
1 parent 204a50d commit 3ed8369
Showing 1 changed file with 46 additions and 11 deletions.
57 changes: 46 additions & 11 deletions .github/workflows/compare-refdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ on:
repository_dispatch:
types: [compare-refdata-command]
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # run at midnight every Sunday

workflow_call: # to be called by pre release workflow

env:
PYTEST_FLAGS_COMPARE: --tardis-refdata=${{ github.workspace }}/tardis-refdata --generate-reference
PYTEST_FLAGS_COMPARE: --tardis-refdata=${{ github.workspace }}/tardis-refdata --tardis-regression-data=${{ github.workspace }}/tardis-regression-data --generate-reference
REF2_HASH: origin/master


Expand All @@ -23,15 +21,50 @@ jobs:
if: github.repository_owner == 'tardis-sn'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Clone tardis-sn/tardis-regression-data
uses: actions/checkout@v4
with:
repository: tardis-sn/tardis-regression-data
path: tardis-regression-data

- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
working-directory: tardis-regression-data

- name: Restore LFS cache
uses: actions/cache/restore@v3
id: lfs-cache-regression-data
with:
path: tardis-regression-data/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-regression-data/.lfs-assets-id') }}-v1

- name: Git LFS Pull
run: git lfs pull
working-directory: tardis-regression-data
if: steps.lfs-cache-regression-data.outputs.cache-hit != 'true'

- name: Git LFS Checkout
run: git lfs checkout
working-directory: tardis-regression-data
if: steps.lfs-cache-regression-data.outputs.cache-hit == 'true'

- name: Save LFS cache if not found
# uses fake ternary
# for reference: https://github.com/orgs/community/discussions/26738#discussioncomment-3253176
if: ${{ steps.lfs-cache-regression-data.outputs.cache-hit != 'true' && always() || false }}
uses: actions/cache/save@v3
id: lfs-cache-regression-data-save
with:
path: tardis-regression-data/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-regression-data/.lfs-assets-id') }}-v1

- name: Checkout TARDIS refdata
uses: actions/checkout@v4
with:
path: tardis-refdata/
lfs: false
ref: master

- run: git remote -v
working-directory: tardis-refdata/

- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
working-directory: tardis-refdata
Expand Down Expand Up @@ -63,16 +96,18 @@ jobs:
path: tardis-refdata/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-refdata/.lfs-assets-id') }}-v1

- uses: actions/checkout@v3
- 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/

- uses: actions/checkout@v3
- name: Checkout TARDIS (PR)
uses: actions/checkout@v4
if: ${{ (github.event_name == 'repository_dispatch') }} # for checking PRs
with:
repository: tardis-sn/tardis
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
path: tardis/
ref: ${{ github.event.client_payload.pull_request.head.ref }}

Expand Down

0 comments on commit 3ed8369

Please sign in to comment.