Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WARNING: Do not edit this file manually.
# Any changes will be overwritten by Copier.
_commit: v0.10.1-41-g508666e
_commit: v0.11.0-7-gb5113cf
_src_path: gh:easyscience/templates
app_docs_url: https://easyscience.github.io/diffraction-app
app_doi: 10.5281/zenodo.18163581
Expand All @@ -17,9 +17,8 @@ lib_python_min: '3.12'
lib_repo_name: diffraction-lib
project_contact_email: support@easydiffraction.org
project_copyright_years: 2021-2026
project_extended_description: A software for calculating neutron powder diffraction
patterns based on a structural model and refining its parameters against experimental
data
project_extended_description: A software for calculating diffraction patterns based
on a structural model and refining its parameters against experimental data
project_name: EasyDiffraction
project_short_description: Diffraction data analysis
project_shortcut: ED
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/download-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Download artifact'
description: 'Generic wrapper for actions/download-artifact'
description: 'Wrapper for actions/download-artifact'
inputs:
name:
description: 'Name of the artifact to download'
Expand Down Expand Up @@ -39,7 +39,7 @@ runs:
using: 'composite'
steps:
- name: Download artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/github-script/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inputs:
runs:
using: 'composite'
steps:
- uses: actions/github-script@v8
- uses: actions/github-script@v9
with:
script: ${{ inputs.script }}
github-token: ${{ inputs.github-token }}
4 changes: 2 additions & 2 deletions .github/actions/setup-easyscience-bot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ runs:
steps:
- name: Create GitHub App installation token
id: app-token
uses: actions/create-github-app-token@v2
uses: actions/create-github-app-token@v3
with:
app-id: ${{ inputs.app-id }}
client-id: ${{ inputs.app-id }}
private-key: ${{ inputs.private-key }}
repositories: ${{ inputs.repositories }}

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-pixi/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Setup Pixi Environment'
description: 'Sets up pixi with common configuration'
description: 'Wrapper for prefix-dev/setup-pixi'
inputs:
environments:
description: 'Pixi environments to setup'
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/upload-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Upload artifact'
description: 'Generic wrapper for actions/upload-artifact'
description: 'Wrapper for actions/upload-artifact'
inputs:
name:
description: 'Artifact name'
Expand Down Expand Up @@ -38,7 +38,7 @@ runs:
using: 'composite'
steps:
- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/upload-codecov/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Upload coverage to Codecov'
description: 'Generic wrapper for codecov/codecov-action@v5'
description: 'Wrapper for codecov/codecov-action'

inputs:
name:
Expand Down Expand Up @@ -32,7 +32,7 @@ inputs:
runs:
using: composite
steps:
- uses: codecov/codecov-action@v5
- uses: codecov/codecov-action@v6
with:
name: ${{ inputs.name }}
flags: ${{ inputs.flags }}
Expand Down
77 changes: 77 additions & 0 deletions .github/scripts/publish-dashboard.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env bash

set -euo pipefail

remote_repository="${DASHBOARD_REMOTE_REPOSITORY:?}"
publish_branch="${DASHBOARD_PUBLISH_BRANCH:-master}"
source_dir="${DASHBOARD_SOURCE_DIR:?}"
token="${DASHBOARD_TOKEN:?}"
git_user_name="${DASHBOARD_GIT_USER_NAME:-easyscience[bot]}"
git_user_email="${DASHBOARD_GIT_USER_EMAIL:?}"
commit_message="${DASHBOARD_COMMIT_MESSAGE:?}"
max_attempts="${DASHBOARD_PUSH_ATTEMPTS:-3}"
delay_seconds="${DASHBOARD_PUSH_DELAY_SECONDS:-15}"

workspace_dir="$(mktemp -d)"
repo_dir="${workspace_dir}/dashboard"
remote_url="https://x-access-token:${token}@github.com/${remote_repository}.git"

cleanup() {
rm -rf "${workspace_dir}"
}

prepare_worktree() {
if [[ ! -d "${repo_dir}/.git" ]]; then
git clone --branch "${publish_branch}" --depth 1 "${remote_url}" "${repo_dir}"
else
git -C "${repo_dir}" fetch origin "${publish_branch}"
git -C "${repo_dir}" checkout "${publish_branch}"
git -C "${repo_dir}" reset --hard "origin/${publish_branch}"
git -C "${repo_dir}" clean -fd
fi

git -C "${repo_dir}" config user.name "${git_user_name}"
git -C "${repo_dir}" config user.email "${git_user_email}"
}

sync_publish_dir() {
cp -R "${source_dir}/." "${repo_dir}/"
git -C "${repo_dir}" add .

if git -C "${repo_dir}" diff --cached --quiet; then
return 1
fi

git -C "${repo_dir}" commit -m "${commit_message}"
}

trap cleanup EXIT

prepare_worktree

if ! sync_publish_dir; then
echo "No dashboard changes to publish."
exit 0
fi

for ((attempt = 1; attempt <= max_attempts; attempt += 1)); do
if git -C "${repo_dir}" push origin "HEAD:${publish_branch}"; then
echo "Dashboard published on attempt ${attempt}."
exit 0
fi

if ((attempt == max_attempts)); then
echo "Dashboard publish failed after ${max_attempts} attempts." >&2
exit 1
fi

echo "Dashboard push attempt ${attempt} failed. Retrying in ${delay_seconds}s." >&2
sleep "${delay_seconds}"

prepare_worktree

if ! sync_publish_dir; then
echo "Dashboard changes already exist in the target repository."
exit 0
fi
done
9 changes: 2 additions & 7 deletions .github/workflows/backmerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,14 @@ concurrency:
group: backmerge-master-into-develop
cancel-in-progress: false

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
backmerge:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository (for local actions)
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup easyscience[bot]
id: bot
Expand All @@ -43,7 +38,7 @@ jobs:
repositories: ${{ github.event.repository.name }}

- name: Checkout repository (with bot token)
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ steps.bot.outputs.token }}
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ on:
days:
description: 'Number of days.'
required: true
default: 30
default: '30'
minimum_runs:
description: 'The minimum runs to keep for each workflow.'
required: true
default: 6
default: '6'
delete_workflow_pattern:
description:
'The name or filename of the workflow. if not set then it will target all
Expand Down Expand Up @@ -61,11 +61,6 @@ on:
- 'false'
- 'true'

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
del-runs:
runs-on: ubuntu-latest
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ concurrency:
# Set the environment variables to be used in all jobs defined in this workflow
env:
CI_BRANCH: ${{ github.head_ref || github.ref_name }}
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
# Job 1: Run docstring coverage
Expand All @@ -37,7 +34,7 @@ jobs:

steps:
- name: Check-out repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Set up pixi
uses: ./.github/actions/setup-pixi
Expand All @@ -51,7 +48,7 @@ jobs:

steps:
- name: Check-out repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Set up pixi
uses: ./.github/actions/setup-pixi
Expand All @@ -74,7 +71,7 @@ jobs:

steps:
- name: Check-out repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Set up pixi
uses: ./.github/actions/setup-pixi
Expand Down
38 changes: 21 additions & 17 deletions .github/workflows/dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ on:
permissions:
contents: read

concurrency:
group: dashboard-publish-${{ github.repository }}
cancel-in-progress: false

# Set the environment variables to be used in all jobs defined in this workflow
env:
CI_BRANCH: ${{ github.head_ref || github.ref_name }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
DEVELOP_BRANCH: develop
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
dashboard:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down Expand Up @@ -84,22 +85,25 @@ jobs:
${{ github.event.repository.name }}
dashboard

# Publish to external dashboard repository with retry logic.
# Push to external dashboard repository with retry logic.
# Retry is needed to handle transient GitHub API/authentication issues
# that occasionally cause 403 errors when multiple workflows push concurrently.
# Uses personal_token (not github_token) as GITHUB_TOKEN cannot access external repos.
- name: Publish to main branch of ${{ github.repository }}
uses: Wandalen/wretry.action@v3.8.0
with:
attempt_limit: 3
attempt_delay: 15000 # 15 seconds between retries
action: peaceiris/actions-gh-pages@v4
with: |
publish_dir: ./_dashboard_publish
keep_files: true
external_repository: ${{ env.REPO_OWNER }}/dashboard
publish_branch: master
personal_token: ${{ steps.bot.outputs.token }}
- name:
Push to ${{ env.REPO_OWNER }}/dashboard/${{ env.REPO_NAME }}/${{ env.CI_BRANCH
}}
shell: bash
env:
DASHBOARD_COMMIT_MESSAGE: ${{ env.CI_BRANCH }}
DASHBOARD_GIT_USER_EMAIL:
${{ vars.EASYSCIENCE_APP_ID }}+easyscience[bot]@users.noreply.github.com
DASHBOARD_PUSH_ATTEMPTS: '3'
DASHBOARD_PUSH_DELAY_SECONDS: '15'
DASHBOARD_PUBLISH_BRANCH: master
DASHBOARD_REMOTE_REPOSITORY: ${{ env.REPO_OWNER }}/dashboard
DASHBOARD_SOURCE_DIR: ./_dashboard_publish
DASHBOARD_TOKEN: ${{ steps.bot.outputs.token }}
run: bash ./.github/scripts/publish-dashboard.sh

- name: Add dashboard link to summary
run: |
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ env:
IS_RELEASE_TAG: ${{ startsWith(github.ref, 'refs/tags/v') }}
GITHUB_REPOSITORY: ${{ github.repository }}
NOTEBOOKS_DIR: tutorials
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
# Single job that builds and deploys documentation.
Expand Down Expand Up @@ -86,7 +83,7 @@ jobs:
# Check out the repository source code.
# Note: The gh-pages branch is fetched separately later for mike deployment.
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

# Activate dark mode to create documentation with Plotly charts in dark mode
# Need a better solution to automatically switch the chart colour theme based on the mkdocs material switcher
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/issues-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ on:
permissions:
issues: write

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
check-labels:
if: github.actor != 'easyscience[bot]'
Expand All @@ -28,7 +23,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup easyscience[bot]
id: bot
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@ permissions:
# Set the environment variables to be used in all jobs defined in this workflow
env:
CI_BRANCH: ${{ github.head_ref || github.ref_name }}
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
lint-format:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Set up pixi
uses: ./.github/actions/setup-pixi
Expand Down
Loading
Loading