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
34 changes: 34 additions & 0 deletions .github/actions/setup-pixi/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Setup Pixi Environment'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a separate action? Use the one in the actions repo.

Check out easyscience/corelib#174

- name: Setup Pixi
      uses: easyscience/actions/pixi@master

description: 'Sets up pixi with common configuration'
inputs:
environments:
description: 'Pixi environments to setup'
required: false
default: 'dev'
activate-environment:
description: 'Environment to activate'
required: false
default: 'dev'
run-install:
description: 'Whether to run install'
required: false
default: 'true'
cache:
description: 'Whether to use cache'
required: false
default: 'false'
post-cleanup:
description: 'Whether to run post cleanup'
required: false
default: 'false'

runs:
using: 'composite'
steps:
- uses: prefix-dev/setup-pixi@v0.9.0
with:
environments: ${{ inputs.environments }}
activate-environment: ${{ inputs.activate-environment }}
run-install: ${{ inputs.run-install }}
cache: ${{ inputs.cache }}
post-cleanup: ${{ inputs.post-cleanup }}
21 changes: 9 additions & 12 deletions .github/workflows/documentation-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v5
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install Pandoc, repo and dependencies
run: |
sudo apt install pandoc
pip install . '.[dev,docs]'

- name: Setup Pixi
uses: ./.github/actions/setup-pixi

- name: Build documentation
run: pixi run docs-build

- name: Build and Commit
uses: sphinx-notes/pages@master
with:
install_requirements: true
documentation_path: docs/src

- name: Push changes
uses: ad-m/github-push-action@master
continue-on-error: true
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/nightly-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nightly Check - install dependencies and run tests after pixi update-lock
name: Nightly Check
on:
schedule:
- cron: '0 0 * * *' # Runs every day at midnight UTC
workflow_dispatch:

jobs:
nightly-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to move this into our actions repo but it's OK for the time being


- name: Setup Pixi
uses: ./.github/actions/setup-pixi

- name: Update lock file
run: pixi run update-lock

- name: Build package
run: pixi run build

- name: Run tox tests
run: pixi run tox
84 changes: 46 additions & 38 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,78 +10,86 @@
#
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: CI using pip
name: CI using Pixi

on: [push, pull_request]

jobs:
Code_Consistency:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- name: Suggestion to fix issues
- uses: actions/checkout@v5
- name: Setup Pixi
uses: ./.github/actions/setup-pixi
- name: Run linting
run: pixi run lint

- name: Suggestion to fix lint issues
if: ${{ failure() }}
run: |
echo "::notice::In project root run 'python.exe -m ruff . --fix' and commit changes to fix issues."
echo "::notice::In project root run 'pixi run lint-fix' and commit changes to fix issues."
exit 1

- name: Run formatting
run: pixi run format-check

- name: Suggestion to fix format issues
if: ${{ failure() }}
run: |
echo "::notice::In project root run 'pixi run format' and commit changes to fix issues."
exit 1

Code_Testing:
strategy:
max-parallel: 4
matrix:
python-version: ['3.9', '3.10', '3.11']
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.11', '3.12', '3.13']
os: [ubuntu-latest, macos-latest, macos-15-intel, windows-latest]

runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: actions/setup-python@v5
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.0
with:
python-version: ${{ matrix.python-version }}
run-install: false
cache: false
post-cleanup: false

- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Set Python version
run: pixi add python=${{ matrix.python-version }}

- name: Install dependencies
run: pip install -e '.[dev]'

- name: Test with tox
run: |
pip install tox tox-gh-actions coverage
tox
- name: Install dependencies and run tests
run: pixi run -e dev test

- name: Upload coverage
uses: codecov/codecov-action@v4
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
name: Pytest coverage
env_vars: OS,PYTHON,GITHUB_ACTIONS,GITHUB_ACTION,GITHUB_REF,GITHUB_REPOSITORY,GITHUB_HEAD_REF,GITHUB_RUN_ID,GITHUB_SHA,COVERAGE_FILE
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
name: unit-tests-job
flags: unittests
files: ./coverage-unit.xml
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
slug: EasyScience/imaging-lib

Package_Testing:

runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Setup Pixi
uses: ./.github/actions/setup-pixi

- name: Install dependencies and build
run: |
pip install -e '.[dev]'
python -m build
- name: Build package
run: pixi run build

- name: Check Build
run: |
cd ./dist
pytest ../
- name: Run tox tests
run: pixi run tox
31 changes: 16 additions & 15 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,26 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.11', '3.12', '3.13']
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and build
run: |
pip install -e '.[dev]'
python -m build
- name: Test with pytest
run: |
cd ./dist
pytest ../
- uses: actions/checkout@v5

- name: Setup Pixi
uses: ./.github/actions/setup-pixi

- name: Set Python version
run: pixi add python=${{ matrix.python-version }}

- name: Build package
run: pixi run build

- name: Run tests with tox
run: pixi run tox

- uses: actions/upload-artifact@v4
with:
name: Upload - Python ${{ matrix.python-version }}
name: EasyImaging - Python ${{ matrix.python-version }}
path: ${{ github.workspace }}/dist/*
overwrite: true
18 changes: 9 additions & 9 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ jobs:
deploy:

runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Setup Pixi
uses: ./.github/actions/setup-pixi

- name: Install dependencies and build
run: |
pip install -e '.[dev]'
python -m build
- name: Build package
run: pixi run build

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_PASSWORD }}
password: ${{ secrets.PYPI_TOKEN_ES }}
31 changes: 31 additions & 0 deletions .github/workflows/verify_issue_labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will verify that all issues have at
# least one of the [scope] labels and one of the [priority] labels

name: Verify issue labels
on:
issues:
types: [opened, labeled, unlabeled]

jobs:
check_issue_labels:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Require [scope] label
uses: trstringer/require-label-prefix@v1
with:
secret: ${{ github.TOKEN }}
prefix: "[scope]"
addLabel: true
defaultLabel: "[scope] ⚠️ label needed"

- name: Require [priority] label
if: always()
uses: trstringer/require-label-prefix@v1
with:
secret: ${{ github.TOKEN }}
prefix: "[priority]"
addLabel: true
defaultLabel: "[priority] ⚠️ label needed"

23 changes: 23 additions & 0 deletions .github/workflows/verify_pr_labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow will verify that all PRs have at
# least one of the [scope] labels before they can be merged.

name: Verify PR labels
on:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]

jobs:
check_pr_label:
runs-on: ubuntu-latest
permissions:
pull-requests: write
name: Verify that the PR has a valid label
steps:
- name: Verify PR label action
uses: jesusvasquez333/verify-pr-label-action@v1.4.0
id: verify-pr-label
with:
github-token: ${{ github.TOKEN }}
valid-labels: '[scope] bug, [scope] enhancement, [scope] documentation, [scope] significant, [scope] maintenance'
pull-request-number: ${{ github.event.pull_request.number }}
disable-reviews: false
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ docs/_build
# VSCode
.vscode

# Pixi
.pixi/

# Large files
*.hdf
*normalized.tiff
*sample.tiff
*open_beam.tiff
ProofOfConcept/sample_data/*.tiff
ProofOfConcept/sample_data/*

# Misc
..*
Expand Down
Loading
Loading