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'
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 }}
33 changes: 15 additions & 18 deletions .github/workflows/documentation-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This pipeline
# - builds developer documentation
# - builds developer documentation using pixi
# - pushes documentation to gh-pages branch of the same repository
#
# Deployment is handled by pages-build-deployment bot
Expand All @@ -23,25 +23,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@5
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@v6
with:
python-version: '3.11'
- name: Install Pandoc, repo and dependencies
run: |
sudo apt install pandoc
pip install . '.[dev,docs]'
- name: Build and Commit
uses: sphinx-notes/pages@master
with:
install_requirements: true
documentation_path: docs/src

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

- name: Build documentation
run: pixi run --environment dev 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

- 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
10 changes: 0 additions & 10 deletions .github/workflows/ossar-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ jobs:
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Ensure a compatible version of dotnet is installed.
# The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201.
# A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action.
# Remote agents already have a compatible version of dotnet installed and this step may be skipped.
# For local agents, ensure dotnet version 3.1.201 or later is installed by including this action:
# - name: Install .NET
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '3.1.x'

# Run open source static analysis tools
- name: Run OSSAR
uses: github/ossar-action@v1
Expand Down
76 changes: 43 additions & 33 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This workflow will for a variety of Python versions
# - install the code base
# - install the code base with pixi
# - lint the code base
# - test the code base
# - upload the test coverage to codecov
Expand All @@ -10,7 +10,7 @@
#
# 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]

Expand All @@ -19,47 +19,62 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: astral-sh/ruff-action@v3
- name: Suggestion to fix issues
- 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.11', '3.12', '3.13']
os: [ubuntu-latest, macos-latest, windows-latest]
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@v5

- uses: actions/setup-python@v6
- 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: Install dependencies
run: pip install -e '.[dev]'
- name: Set Python version
run: pixi add python=${{ matrix.python-version }}

- 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.0.1
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN_NEW }}
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/corelib

Package_Testing:

Expand All @@ -69,16 +84,11 @@ jobs:
steps:
- uses: actions/checkout@v5

- uses: actions/setup-python@v6
with:
python-version: '3.11'
- 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: |
pip install tox tox-gh-actions coverage
tox
- name: Run tox tests
run: pixi run tox
29 changes: 15 additions & 14 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# This workflow will for a variety of Python versions
# - build a python package
# - build a python package using pixi
# - run tests on the produced package
# - upload the package as an artifact
#
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Create Python Package
name: Create Python Package using pixi


on:
Expand All @@ -26,18 +26,19 @@ jobs:

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

- 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: EasyScience - Python ${{ matrix.python-version }}
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This workflow will
# - build distribution package, pure python wheel
# - build distribution package, pure python wheel using pixi
# - publish produced distribution package to PyPI
#
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
Expand All @@ -26,14 +26,11 @@ jobs:
steps:
- uses: actions/checkout@v5

- uses: actions/setup-python@v6
with:
python-version: '3.11'
- 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
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/release-drafter-verify_pr_labels.yml

This file was deleted.

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"

Loading
Loading