Skip to content
Open
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
72 changes: 72 additions & 0 deletions .badgery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
default_branch: master
develop_branch: develop

cards:
- group: Tests
type: gh_action
title: Code/package tests (GitHub)
file: test.yml
enabled: true
- group: Tests
type: gh_action
title: Tutorial tests (GitHub)
file: tutorial-tests.yml
enabled: true

- group: Tests
type: gh_action
title: Package tests (PyPI)
file: pypi-test.yml
enabled: true

- group: Code Quality
type: codefactor
title: Code quality (CodeFactor)
enabled: true

- group: Code Quality
type: radon_mi
title: Maintainability index (radon)
report: reports/{branch}/maintainability-index.json
enabled: true

- group: Code Quality
type: radon_cc
title: Cyclomatic complexity (radon)
report: reports/{branch}/cyclomatic-complexity.json
enabled: true

- group: Size
type: radon_loc
title: Source/Logical lines of code (radon)
report: reports/{branch}/raw-metrics.json
enabled: true

- group: Size
type: radon_ff
title: Functions/Files count (radon)
report: reports/{branch}/cyclomatic-complexity.json
enabled: true

- group: Coverage
type: codecov
title: Unit test coverage (Codecov)
flag: unittests
enabled: true

- group: Coverage
type: interrogate
title: Docstring coverage (interrogate)
report: reports/{branch}/coverage-docstring.txt
enabled: true
- group: Build & Release
type: gh_action
title: Publishing (PyPI)
workflow: pypi-publish.yml
enabled: true

- group: Build & Release
type: gh_action
title: Docs build/deployment
workflow: docs.yml
enabled: true
27 changes: 27 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Codecov configuration
# https://docs.codecov.com/docs/codecov-yaml

github_checks:
annotations: true

comment:
layout: 'reach, diff, flags, files'
behavior: default
require_changes: false
require_base: false
require_head: true

coverage:
status:
project:
default:
target: 80%
threshold: 0%
# require project coverage, don't allow wiggle room.
informational: false
patch:
default:
target: 80%
threshold: 5%
# Make patch coverage informational (won't block PR)
informational: true
38 changes: 27 additions & 11 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: e4625c1
_src_path: gh:/EasyScience/EasyProjectTemplate
description: Python package for bragg-edge analysis
max_python: '3.12'
min_python: '3.9'
orgname: EasyScience
packagename: easyimaging
prettyname: Easyimaging
projectname: EasyImaging
year: 2024
# WARNING: Do not edit this file manually.
# Any changes will be overwritten by Copier.
_commit: v0.11.4
_src_path: gh:easyscience/templates
app_docs_url: https://easyscience.github.io/imaging-app
app_doi: 10.5281/zenodo.18163581
app_package_name: easyimaging_app
app_python: '3.13'
app_repo_name: imaging-app
home_page_url: https://easyscience.github.io/imaging
home_repo_name: imaging
lib_docs_url: https://easyscience.github.io/imaging-lib
lib_doi: 10.5281/zenodo.18163581
lib_package_name: easyimaging
lib_python_max: '3.13'
lib_python_min: '3.11'
lib_repo_name: imaging-lib
project_contact_email: support@easyscience.org
project_copyright_years: 2024-2026
project_extended_description: A software for performing Bragg-edge calculations based
on a crystalliographic model and refining its parameters against experimental
data
project_name: EasyImaging
project_short_description: Neutron imaging data analysis
project_shortcut: EI
project_type: both
template_type: lib
50 changes: 50 additions & 0 deletions .github/actions/download-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: 'Download artifact'
description: 'Wrapper for actions/download-artifact'
inputs:
name:
description: 'Name of the artifact to download'
required: true

path:
description: 'Destination path'
required: false
default: '.'

pattern:
description: 'Glob pattern to match artifact names (optional)'
required: false
default: ''

merge-multiple:
description: 'Merge multiple artifacts into the same directory'
required: false
default: 'false'

github-token:
description: 'GitHub token for cross-repo download (optional)'
required: false
default: ''

repository:
description: 'owner/repo for cross-repo download (optional)'
required: false
default: ''

run-id:
description: 'Workflow run ID for cross-run download (optional)'
required: false
default: ''

runs:
using: 'composite'
steps:
- name: Download artifact
uses: actions/download-artifact@v8
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
pattern: ${{ inputs.pattern }}
merge-multiple: ${{ inputs.merge-multiple }}
github-token: ${{ inputs.github-token }}
repository: ${{ inputs.repository }}
run-id: ${{ inputs.run-id }}
19 changes: 19 additions & 0 deletions .github/actions/github-script/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'GitHub Script'
description: 'Wrapper for actions/github-script'
inputs:
script:
description: 'JavaScript to run'
required: true

github-token:
description: 'GitHub token (defaults to github.token)'
required: false
default: ${{ github.token }}

runs:
using: 'composite'
steps:
- uses: actions/github-script@v9
with:
script: ${{ inputs.script }}
github-token: ${{ inputs.github-token }}
40 changes: 40 additions & 0 deletions .github/actions/setup-easyscience-bot/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Setup EasyScience bot for pushing'
description: 'Create GitHub App token and configure git identity + origin remote'
inputs:
app-id:
description: 'GitHub App ID'
required: true
private-key:
description: 'GitHub App private key (PEM)'
required: true
repositories:
description: 'Additional repositories to grant access to (newline-separated)'
required: false
default: ''

outputs:
token:
description: 'Installation access token'
value: ${{ steps.app-token.outputs.token }}

runs:
using: 'composite'
steps:
- name: Create GitHub App installation token
id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ inputs.app-id }}
private-key: ${{ inputs.private-key }}
repositories: ${{ inputs.repositories }}

- name: Configure git for pushing
shell: bash
run: |
git config user.name "easyscience[bot]"
git config user.email "${{ inputs.app-id }}+easyscience[bot]@users.noreply.github.com"

- name: Configure origin remote to use the bot token
shell: bash
run: |
git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}.git
22 changes: 16 additions & 6 deletions .github/actions/setup-pixi/action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
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'
required: false
default: 'dev'
default: 'default'
activate-environment:
description: 'Environment to activate'
required: false
default: 'dev'
default: 'default'
run-install:
description: 'Whether to run install'
description: 'Whether to run pixi install'
required: false
default: 'true'
locked:
description: 'Whether to run pixi install --locked'
required: false
default: 'false'
frozen:
description: 'Whether to run pixi install --frozen'
required: false
default: 'true'
cache:
Expand All @@ -25,10 +33,12 @@ inputs:
runs:
using: 'composite'
steps:
- uses: prefix-dev/setup-pixi@v0.9.0
- uses: prefix-dev/setup-pixi@v0.9.5
with:
environments: ${{ inputs.environments }}
activate-environment: ${{ inputs.activate-environment }}
run-install: ${{ inputs.run-install }}
locked: ${{ inputs.locked }}
frozen: ${{ inputs.frozen }}
cache: ${{ inputs.cache }}
post-cleanup: ${{ inputs.post-cleanup }}
post-cleanup: ${{ inputs.post-cleanup }}
49 changes: 49 additions & 0 deletions .github/actions/upload-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 'Upload artifact'
description: 'Wrapper for actions/upload-artifact'
inputs:
name:
description: 'Artifact name'
required: true

path:
description: 'File(s)/dir(s)/glob(s) to upload (newline-separated)'
required: true

include-hidden-files:
description: 'Include hidden files'
required: false
default: 'true'

if-no-files-found:
description: 'warn | error | ignore'
required: false
default: 'error'

compression-level:
description: '0-9 (0 = no compression)'
required: false
default: '0'

retention-days:
description: 'Retention in days (optional)'
required: false
default: ''

overwrite:
description: 'Overwrite an existing artifact with the same name'
required: false
default: 'false'

runs:
using: 'composite'
steps:
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
include-hidden-files: ${{ inputs.include-hidden-files }}
if-no-files-found: ${{ inputs.if-no-files-found }}
compression-level: ${{ inputs.compression-level }}
retention-days: ${{ inputs.retention-days }}
overwrite: ${{ inputs.overwrite }}
42 changes: 42 additions & 0 deletions .github/actions/upload-codecov/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'Upload coverage to Codecov'
description: 'Wrapper for codecov/codecov-action'

inputs:
name:
description: 'Codecov upload name'
required: true

flags:
description: 'Codecov flags'
required: false
default: ''

files:
description: 'Coverage report files'
required: true

fail_ci_if_error:
description: 'Fail CI if upload fails'
required: false
default: 'true'

verbose:
description: 'Enable verbose output'
required: false
default: 'true'

token:
description: 'Codecov token'
required: true

runs:
using: composite
steps:
- uses: codecov/codecov-action@v6
with:
name: ${{ inputs.name }}
flags: ${{ inputs.flags }}
files: ${{ inputs.files }}
fail_ci_if_error: ${{ inputs.fail_ci_if_error }}
verbose: ${{ inputs.verbose }}
token: ${{ inputs.token }}
6 changes: 6 additions & 0 deletions .github/configs/pages-deployment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"source": {
"branch": "gh-pages",
"path": "/"
}
}
Loading
Loading