Skip to content

Commit

Permalink
Merge branch 'master' into mc-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfullard committed Jun 7, 2024
2 parents 8ed16a0 + 6fffa69 commit 8b9fe2a
Show file tree
Hide file tree
Showing 23 changed files with 413 additions and 298 deletions.
167 changes: 83 additions & 84 deletions .github/actions/setup_lfs/action.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,96 @@
name: 'Setup LFS'
description: 'Pull LFS repositories and caches them'
name: "Setup LFS"
description: "Pull LFS repositories and caches them"

inputs:
refdata-repo:
description: "tardis refdata repository"
required: false
default: 'tardis-sn/tardis-refdata'
regression-data-repo:
default: "tardis-sn/tardis-refdata"
regression-data-repo:
description: "tardis regression data repository"
required: false
default: 'tardis-sn/tardis-regression-data'
default: "tardis-sn/tardis-regression-data"

runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- name: Clone Refdata Repo
uses: actions/checkout@v4
with:
repository: ${{ inputs.refdata-repo }}
path: tardis-refdata
lfs: false
using: "composite"
steps:
- name: Clone Refdata Repo
uses: actions/checkout@v4
with:
repository: ${{ inputs.refdata-repo }}
path: tardis-refdata
lfs: false

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

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

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

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

- 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-refdata.outputs.cache-hit != 'true' && always() || false }}
uses: actions/cache/save@v3
id: lfs-cache-refdata-save
with:
path: tardis-refdata/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-refdata/.lfs-assets-id') }}-v1

- name: Clone tardis-sn/tardis-regression-data
uses: actions/checkout@v4
with:
repository: ${{ inputs.regression-data-repo }}
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
shell: bash
- name: Git LFS Pull
run: git lfs pull
working-directory: tardis-refdata
if: steps.lfs-cache-refdata.outputs.cache-hit != 'true'
shell: bash

- 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'
shell: bash

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

- 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: Git LFS Checkout
run: git lfs checkout
working-directory: tardis-refdata
if: steps.lfs-cache-refdata.outputs.cache-hit == 'true'
shell: bash

- 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-refdata.outputs.cache-hit != 'true' && always() || false }}
uses: actions/cache/save@v4
id: lfs-cache-refdata-save
with:
path: tardis-refdata/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-refdata/.lfs-assets-id') }}-v1

- name: Clone tardis-sn/tardis-regression-data
uses: actions/checkout@v4
with:
repository: ${{ inputs.regression-data-repo }}
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
shell: bash

- name: Restore LFS cache
uses: actions/cache/restore@v4
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'
shell: bash

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

- 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@v4
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
10 changes: 5 additions & 5 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ jobs:
contains(github.event.pull_request.labels.*.name, 'benchmarks')))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 0

- name: Checkout pull/${{ github.event.number }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
fetch-depth: 0
if: github.event_name == 'pull_request_target'

- name: Restore Atom Data
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: atom-data-restore
with:
path: benchmarks/data/kurucz_cd23_chianti_H_He.h5
Expand All @@ -59,7 +59,7 @@ jobs:
wget -q "$REPO_URL/items?path=atom_data/kurucz_cd23_chianti_H_He.h5&versionType=branch&version=master&resolveLfs=true" -O benchmarks/data/kurucz_cd23_chianti_H_He.h5
- name: Save Atom Data
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: ${{ steps.atom-data-restore.outputs.cache-hit != 'true' && always() || false }}
id: atom-data-cache-save
with:
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
URL: https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}?check_suite_focus=true

- name: Save results artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: asv-benchmark-results-${{ runner.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
EVENT: ${{ github.event_name }}

- name: Deploy ${{ env.DEST_DIR }}
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.BOT_TOKEN }}
publish_branch: ${{ env.DEPLOY_BRANCH }}
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/clean-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,24 @@
name: clean-docs

on:

delete:
branches: # remove deleted branches
- '*'
branches: # remove deleted branches
- "*"

pull_request_target: # remove closed or merged pull requests
pull_request_target: # remove closed or merged pull requests
branches:
- '*'
- "*"
types:
- closed

env:
DEPLOY_BRANCH: gh-pages # deployed docs branch
DEPLOY_BRANCH: gh-pages # deployed docs branch

jobs:
clean:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set folder to delete
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.x

Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/docstr-cov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Log in to jsonbin.org with tardis-bot GitHub account to get an API key and
# Log in to jsonbin.org with tardis-bot GitHub account to get an API key and
# store it as a repository secret.

# Updated badge will be available at:
Expand All @@ -9,11 +9,11 @@ name: docstr-cov
on:
push:
branches:
- master
- master

pull_request:
branches:
- master
- master

env:
THRESHOLD: 0.05
Expand All @@ -25,13 +25,12 @@ jobs:
check:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.x

Expand All @@ -47,7 +46,7 @@ jobs:
elif [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "BASE=${{ github.event.pull_request.base.sha }}" >> $GITHUB_ENV
echo "HEAD=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "Unexpected event trigger"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mailmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
Expand Down
Loading

0 comments on commit 8b9fe2a

Please sign in to comment.