Skip to content

[pre-commit.ci] pre-commit autoupdate #298

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #298

Workflow file for this run

name: unit-test
on:
workflow_dispatch:
pull_request:
push:
branches: [next, qa, main]
tags: ['v*']
permissions:
contents: read
# cancel previous job if new commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# real per-version pixi environments (SPEC 0 window); the default
# env was previously held at Python 3.11 by the packaging stack
environment: [py312, py313, py314]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
manifest-path: pyproject.toml
environments: ${{ matrix.environment }}
- name: run unit tests
run: |
echo "running unit tests"
pixi run -e ${{ matrix.environment }} test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
if: matrix.environment == 'py312'
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ornlneutronimaging/HyperCTui
# every published wheel/conda artifact used to crash at startup because
# config.json was missing from package-data; this job keeps the packaged
# data-file set honest on every PR
packaging-smoke:
name: wheel packages required data files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
fetch-tags: true
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
manifest-path: pyproject.toml
environments: package
- name: Build wheel and assert packaged data files
run: |
pixi run -e package python -m build --wheel --outdir /tmp/wheelcheck
wheel=$(ls /tmp/wheelcheck/*.whl)
for f in hyperctui/config.json hyperctui/static/golden_angle.csv hyperctui/ui/main_application.ui; do
unzip -l "$wheel" | grep -q "$f" || { echo "MISSING from wheel: $f"; exit 1; }
done
echo "wheel contains required data files"
# grype scans the installed pixi env (pip + conda packages), gates only on
# fixable findings, and uploads SARIF to the Security tab (org decision
# 2026-06-10: grype replaces pip-audit)
dependency-scan:
name: Scan dependencies with Grype
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write # required for upload-sarif
actions: read # upload-sarif on private repos
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
manifest-path: pyproject.toml
environments: default
- name: Scan pixi environment with Grype
uses: neutrons/conda-actions/grype@bba9ca89d48d9ae846db9650cc63fde736340b3d # v2
with:
path: ${{ github.workspace }}/.pixi/envs/default
# only-fixed defaults to true in the v2 wrapper, so unfixable
# advisories never fail the build
fail-build: false