Skip to content

Commit

Permalink
Merge branch 'master' into mc-config-refactor-numba
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfullard committed May 6, 2024
2 parents 8224fdc + 328ec77 commit 6d06b34
Show file tree
Hide file tree
Showing 141 changed files with 7,239 additions and 2,534 deletions.
124 changes: 0 additions & 124 deletions .azure-pipelines/compare-refdata.yml

This file was deleted.

90 changes: 0 additions & 90 deletions .azure-pipelines/templates/default.yml

This file was deleted.

97 changes: 97 additions & 0 deletions .github/actions/setup_lfs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
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:
description: "tardis regression data repository"
required: false
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

- 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: 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: 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
5 changes: 3 additions & 2 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ defaults:

jobs:
build:
if: github.event_name == 'push' ||
if: github.repository_owner == 'tardis-sn' &&
(github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request_target' &&
contains(github.event.pull_request.labels.*.name, 'benchmarks'))
contains(github.event.pull_request.labels.*.name, 'benchmarks')))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
29 changes: 13 additions & 16 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,20 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
if: github.event_name == 'pull_request_target'

- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
- name: Generate Cache Key
run: |
file_hash=$(cat conda-linux-64.lock | shasum -a 256 | cut -d' ' -f1)
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}"
id: cache-environment-key

- uses: mamba-org/setup-micromamba@v1
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: tardis
use-mamba: true

- uses: actions/cache@v2
with:
path: /usr/share/miniconda3/envs/tardis
key: conda-linux-64-${{ hashFiles('conda-linux-64.lock') }}-${{ env.CACHE_NUMBER }}
id: cache-conda

- name: Update environment
run: mamba update -n tardis --file conda-linux-64.lock
if: steps.cache-conda.outputs.cache-hit != 'true'
environment-file: conda-linux-64.lock
cache-environment-key: ${{ steps.cache-environment-key.outputs.file_hash }}
cache-downloads-key: ${{ steps.cache-environment-key.outputs.file_hash }}
environment-name: tardis
cache-environment: true
cache-downloads: true

- name: Install package
run: pip install -e .
Expand Down
21 changes: 2 additions & 19 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ name: codestyle
on:
push:
branches:
- '*'
- "*"

pull_request:
branches:
- '*'
- "*"

jobs:
black:
Expand All @@ -29,20 +29,3 @@ jobs:

- name: Run Black
run: black --check tardis

flake8:
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

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

- name: Install Flake8
run: pip install flake8==4.0.1 pep8-naming==0.12.1

- name: Run Flake8
run: flake8 tardis
Loading

0 comments on commit 6d06b34

Please sign in to comment.