Skip to content

Commit

Permalink
Merge branch 'master' into pr/Rodot-/2800-1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfullard committed Jan 13, 2025
2 parents 9938e6f + b4bc6ac commit 1fba621
Show file tree
Hide file tree
Showing 60 changed files with 1,729 additions and 618 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ jobs:
python
asv=0.6.4
mamba
libmambapy<2.0
conda-build
conda=24.9.0
conda=24.11.0
- name: Accept all asv questions
run: asv machine --yes
Expand Down
48 changes: 19 additions & 29 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
outputs:
should-run: ${{ steps.check_conditions.outputs.should-run }}
trigger-check-outcome: ${{ steps.trigger_check.outcome }}
docs-check-outcome: ${{ steps.docs_check.outcome }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
Expand All @@ -52,43 +53,32 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
if: github.event_name == 'pull_request_target'

- id: check_conditions
name: Check conditions for running workflow
- name: Check for trigger by push event, manual dispatch, build-docs label on a PR
id: trigger_check
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'build-docs')
run: |
# Initialize should-run as false
echo "should-run=false" >> $GITHUB_OUTPUT
# Always run for push and workflow_dispatch
if [[ "${{ github.event_name }}" == "push" ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "should-run=true" >> $GITHUB_OUTPUT
exit 0
fi
# For pull_request_target events
if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
# Check if docs directory has changes
HAS_DOCS_CHANGES=false
if git diff origin/master..."$(git rev-parse --abbrev-ref HEAD)" --name-only | cat | grep '^docs/' | grep -q .; then
HAS_DOCS_CHANGES=true
echo "Building docs as a test."
exit 0
continue-on-error: true

- name: Check for changes in documentation
run: |
if git diff origin/master..."$(git rev-parse --abbrev-ref HEAD)" --name-only | cat | grep '^docs/' | grep -q .; then
num_files=$(git diff --name-only origin/master...HEAD | grep '^docs/' | wc -l)
echo "Changes found in documentation files: $num_files"
else
exit 0
else
echo "No changes found in documentation files - will stop running the pipeline."
fi
# Check if PR has build-docs label
HAS_BUILD_DOCS_LABEL=${{ contains(github.event.pull_request.labels.*.name, 'build-docs') }}
if [[ "$HAS_DOCS_CHANGES" == "true" && "$HAS_BUILD_DOCS_LABEL" == "false" ]] || \
[[ "$HAS_DOCS_CHANGES" == "false" && "$HAS_BUILD_DOCS_LABEL" == "true" ]]; then
echo "should-run=true" >> $GITHUB_OUTPUT
fi
exit 1
fi
id: docs_check
if: steps.trigger_check.outcome != 'success'
continue-on-error: true

build-docs:
runs-on: ubuntu-latest
needs: check-for-changes
if: needs.check-for-changes.outputs.should-run == 'true'
if: needs.check-for-changes.outputs.trigger-check-outcome == 'success' || needs.check-for-changes.outputs.docs-check-outcome == 'success'
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: orhun/git-cliff-action@v3
with:
config: pyproject.toml
args: --verbose
args: --verbose --tag ${{ github.event.release.tag_name }}
env:
OUTPUT: CHANGELOG.md

Expand Down
150 changes: 0 additions & 150 deletions .github/workflows/pre-release.yml

This file was deleted.

65 changes: 56 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,62 @@
name: release

on:
pull_request_target:
branches: [master]
types: [closed]

schedule:
- cron: "0 0 * * 0"
workflow_dispatch: # manual trigger

defaults:
run:
shell: bash -l {0}


jobs:
create:
if: github.event_name == 'workflow_dispatch' ||
(startsWith(github.head_ref, 'pre-release-20') && github.event.pull_request.merged == true)
pip_tests:
uses: ./.github/workflows/tests.yml
secrets: inherit
with:
pip_git: true
zenodo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: tardis-sn/tardis_zenodo
token: ${{ secrets.BOT_TOKEN }}

- name: Checkout setup_env action
uses: actions/checkout@v4
with:
repository: tardis-sn/tardis
sparse-checkout: |
.github/actions/setup_env/action.yml
sparse-checkout-cone-mode: true
path: tardis

- name: Setup environment
uses: ./tardis/.github/actions/setup_env
with:
os-label: "linux-64"

- name: Dump Secret Key
run: echo "$KEY_SECRET_JSON" > key_secret.json
env:
KEY_SECRET_JSON: ${{ secrets.ZENODO_KEY_SECRET_JSON }}

- name: Run Notebook
run: jupyter nbconvert gather_data.ipynb --to html --execute --ExecutePreprocessor.timeout=6000

- name: Run Notebook (allow errors)
run: jupyter nbconvert gather_data.ipynb --to html --execute --ExecutePreprocessor.timeout=6000 --allow-errors
if: failure()

- uses: actions/upload-artifact@v4
with:
name: zenodo_json
path: .zenodo.json

create:
needs: [pip_tests, zenodo]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -43,6 +88,7 @@ jobs:
with:
name: TARDIS v${{ env.NEW_TAG }}
tag_name: release-${{ env.NEW_TAG }}
token: ${{ secrets.BOT_TOKEN }}
body: "This release has been created automatically by the TARDIS continuous delivery pipeline."
draft: false

Expand Down Expand Up @@ -73,7 +119,7 @@ jobs:
- name: Generate and process changelog
run: |
CHANGELOG=$(git cliff --config pyproject.toml --unreleased | sed -n '/^## Changelog/,$p' | grep -vE '^(ERROR|WARN)')
CHANGELOG=$(git cliff --config pyproject.toml --unreleased --tag ${{ env.NEW_TAG }}| sed -n '/^## Changelog/,$p' | grep -vE '^(ERROR|WARN)')
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
Expand All @@ -82,11 +128,12 @@ jobs:
uses: softprops/action-gh-release@v1
with:
tag_name: release-${{ env.NEW_TAG }}
token: ${{ secrets.BOT_TOKEN }}
body: |
This release has been created automatically by the TARDIS continuous delivery pipeline.
${{ env.doi_badge }}
${{ env.CHANGELOG }}
A complete list of changes for this release is available at [CHANGELOG.md](https://github.com/tardis-sn/tardis/blob/master/CHANGELOG.md).
files: |
conda-osx-arm64.lock
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- opened
- reopened
- synchronize
- labeled

workflow_call:
inputs:
pip_git:
Expand Down
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ Stuart Sim <s.sim@qub.ac.uk> ssim <ssim@users.noreply.github.com>
Stuart Sim <s.sim@qub.ac.uk> Stuart Sim <ssim@mso.anu.edu.au>
Stuart Sim <s.sim@qub.ac.uk> Stuart Sim <stuartsim@bashir.pst.qub.ac.uk>

Swayam Shah <swayamshah66@gmail.com> Sonu0305 <swayamshah66@gmail.com>

TARDIS Bot <tardis.sn.bot@gmail.com>
TARDIS Bot <tardis.sn.bot@gmail.com> tardis-bot <tardis.sn.bot@gmail.com>
TARDIS Bot <tardis.sn.bot@gmail.com> TARDIS Bot <wkerzendorf+tardis@gmail.com>
Expand Down
Loading

0 comments on commit 1fba621

Please sign in to comment.