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
65 changes: 46 additions & 19 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ on:
pull_request:
push:
branches: [next]
tags: ['v*']
tags: ["v*"]

# cancel previous job if new commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PKG_NAME: hyspecppt
Expand All @@ -18,24 +23,22 @@ jobs:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Checkout
uses: actions/checkout@v6

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.48.2
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3

- name: Install hyspecppt
run: pixi run python -m pip install -e .
- name: Install hyspecppt
run: pixi run python -m pip install -e .

- name: Run tests
run: pixi run xvfb-run --server-args="-screen 0 1920x1080x24" -a python -m pytest --cov=src --cov-report=xml --cov-report=term
- name: Run tests
run: pixi run xvfb-run --server-args="-screen 0 1920x1080x24" -a python -m pytest --cov=src --cov-report=xml --cov-report=term

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

build:
name: Conda build with Pixi
Expand All @@ -50,8 +53,6 @@ jobs:

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.48.2

- name: Build Conda package
run: pixi run conda-build
Expand Down Expand Up @@ -127,8 +128,6 @@ jobs:

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.48.2

- name: Download previous conda package artifact
uses: actions/download-artifact@v7
Expand All @@ -153,3 +152,31 @@ jobs:
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
echo pushing ${{ github.ref }} with label $CONDA_LABEL
pixi run anaconda upload --label $CONDA_LABEL --user neutrons ${{ env.PKG_NAME }}-*.conda

# Trigger GitLab dev deploy pipeline
deploy-dev:
runs-on: ubuntu-latest
needs: build
# if: github.ref == 'refs/heads/next'
steps:
- name: Get Environment Name
uses: neutrons/branch-mapper@main
id: env_name
with:
prefix: ${{ env.PKG_NAME }}

- name: Trigger Dev Deploy
# use https://github.com/eic/trigger-gitlab-ci/pull/14 until merged
uses: eic/trigger-gitlab-ci@d984d8d53d871d2fdc1325639d94322da6e8747f
id: trigger
with:
url: https://code.ornl.gov
project_id: 18005
ref_name: main
token: ${{ secrets.GITLAB_DEPLOY_TOKEN }}

- name: Annotate commit
uses: peter-evans/commit-comment@v4
with:
body: |
GitLab pipeline for ${{ steps.env_name.outputs.name }} has been submitted for this commit: ${{ steps.trigger.outputs.web_url }}
2 changes: 1 addition & 1 deletion .github/workflows/update-lockfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
title: Update pixi lockfile
body-path: diff.md
branch: update-pixi
base: next # change this to the default branch of your repository
base: next # change this to the default branch of your repository
labels: pixi
delete-branch: true
add-paths: pixi.lock
Loading
Loading