Skip to content

dc now available. this refs #274 #1091

dc now available. this refs #274

dc now available. this refs #274 #1091

name: Test and Deploy
on:
push:
branches: [main, next, qa]
pull_request:
workflow_dispatch:
jobs:
run-unit-tests:
runs-on: ubuntu-22.04
timeout-minutes: 60
name: Run tests
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: latest
manifest-path: pyproject.toml
cache: true
environments: default
- name: Run import tests
run: pixi run test_imports
- name: Run unit tests
run: pixi run test
- name: Run linting (informational only)
run: pixi run -e dev lint || echo "Linting issues found (non-blocking)"
continue-on-error: true
- name: Audit dependencies (informational only)
run: pixi run -e dev audit || echo "Vulnerabilities found (non-blocking)"
continue-on-error: true
trigger-deploy-notebooks:
runs-on: ubuntu-22.04
timeout-minutes: 60
# only trigger deploys from protected branches
if: ${{ github.ref_protected }}
needs: run-unit-tests
steps:
- name: Map the Branch Name to a Notebook Collection
uses: neutrons/branch-mapper@modifiedMain
id: notebook_collection
with:
prefix: "IPTS_notebooks"
suffix-default: "_testing"
- name: Trigger deploy
id: trigger
uses: eic/trigger-gitlab-ci@v2
with:
url: https://code.ornl.gov
token: ${{ secrets.GITLAB_TRIGGER_TOKEN_NOTEBOOKS}}
project_id: 11602
ref_name: main
variables: |
PLAY="imaging"
EXTRAARGS="NOTEBOOK_COLLECTION_NAME=${{ steps.notebook_collection.outputs.name }}"
- name: Annotate commit
uses: peter-evans/commit-comment@v3
with:
body: |
GitLab pipeline with NOTEBOOK_COLLECTION_NAME=${{ steps.notebook_collection.outputs.name }} submitted for commit ${{ steps.trigger.outputs.web_url }}