Skip to content

Commit 2e25ca7

Browse files
committed
add github workflows
1 parent a9f8385 commit 2e25ca7

6 files changed

Lines changed: 239 additions & 9 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions" # See documentation for possible values
9+
directory: "/" # Workflow files stored in the default location of `.github/workflows`
10+
schedule:
11+
interval: "weekly"

.github/pull_request_template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Description of work:
2+
3+
Check all that apply:
4+
- [ ] Documentation updated
5+
- [ ] Source added/refactored
6+
- [ ] Unit tests added/refactored
7+
- [ ] Integration tests added/refactored
8+
9+
**References:**
10+
- Links to IBM EWM items:
11+
- Links to related issues or pull requests:
12+
13+
## :warning: Manual test for the reviewer
14+
(Instructions for testing here)
15+
16+
## Check list for the reviewer
17+
- [ ] best software practices
18+
+ [ ] clearly named variables (better to be verbose in variable names)
19+
+ [ ] code comments explaining the intent of code blocks
20+
- [ ] All the tests are passing
21+
- [ ] The documentation is up to date
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: Tests, Package, and Deployment
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches: [next, qa, main]
8+
tags: ["v*"]
9+
10+
# cancel previous job if new commit is pushed
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
PKG_NAME: dgs_resolution
17+
18+
jobs:
19+
#################
20+
### Run Tests ###
21+
#################
22+
23+
# tests:
24+
# runs-on: ubuntu-latest
25+
# defaults:
26+
# run:
27+
# shell: bash -el {0}
28+
# steps:
29+
# - name: Checkout
30+
# uses: actions/checkout@v6
31+
32+
# - name: Setup Pixi
33+
# uses: prefix-dev/setup-pixi@v0.9.4
34+
35+
# - name: Install chromium
36+
# run: |
37+
# echo "chromium enables testing HTML reports"
38+
# sudo apt-get install --yes chromium-browser
39+
40+
# - name: Run unit tests
41+
# run: |
42+
# pixi run test -vv -m "not datarepo and not sns_mounted" --cov=src --cov-report=xml --cov-report=term-missing tests/
43+
# mv .coverage .coverage.unit
44+
45+
# - name: Run integration tests
46+
# run: |
47+
# git submodule update --init
48+
# pixi run test -vv -m "datarepo" --cov=src --cov-report=xml --cov-report=term-missing tests/
49+
# mv .coverage .coverage.integration
50+
51+
# - name: Upload coverage to codecov
52+
# uses: codecov/codecov-action@v5
53+
# with:
54+
# token: ${{ secrets.CODECOV_TOKEN }}
55+
56+
##############################
57+
### Package and Deployment ###
58+
##############################
59+
60+
build:
61+
runs-on: ubuntu-latest
62+
defaults:
63+
run:
64+
shell: bash -el {0}
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v6
68+
with:
69+
fetch-depth: 100
70+
fetch-tags: true
71+
ref: ${{ github.ref }}
72+
73+
- name: Setup Pixi
74+
uses: prefix-dev/setup-pixi@v0.9.4
75+
76+
- name: Build conda package
77+
run: |
78+
pixi run conda-build
79+
mkdir -p /tmp/local-channel/linux-64
80+
cp ${{ env.PKG_NAME }}-*.conda /tmp/local-channel/linux-64/
81+
82+
- name: Verify Conda Package
83+
uses: neutrons/conda-verify@main
84+
with:
85+
python-version: "3.11"
86+
local-channel: /tmp/local-channel
87+
package-name: ${{ env.PKG_NAME }}
88+
89+
# Upload the conda package for job "publish" to use later
90+
- name: upload conda package as artifact
91+
uses: actions/upload-artifact@v6
92+
if: startsWith(github.ref, 'refs/tags/v')
93+
with:
94+
name: artifact-conda-package
95+
path: ${{ env.PKG_NAME }}-*.conda
96+
97+
# Publish the package as a separate job so that the Github Actions webpage
98+
# shows it as a separate step in the CI workflow
99+
publish:
100+
runs-on: ubuntu-latest
101+
needs: [tests, build]
102+
if: startsWith(github.ref, 'refs/tags/v')
103+
defaults:
104+
run:
105+
shell: bash -el {0}
106+
steps:
107+
- name: Checkout
108+
uses: actions/checkout@v6
109+
with:
110+
fetch-depth: 100
111+
fetch-tags: true
112+
ref: ${{ github.ref }}
113+
114+
- name: Setup Pixi
115+
uses: prefix-dev/setup-pixi@v0.9.4
116+
117+
- name: Download conda package artifact
118+
uses: actions/download-artifact@v7
119+
with:
120+
name: artifact-conda-package
121+
122+
- name: Upload package to anaconda
123+
env:
124+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
125+
IS_RC: ${{ contains(github.ref, 'rc') }}
126+
run: |
127+
# label is main or rc depending on the tag-name
128+
CONDA_LABEL="main"
129+
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
130+
echo pushing ${{ github.ref }} with label $CONDA_LABEL
131+
pixi run anaconda upload --label $CONDA_LABEL --user neutrons ${{ env.PKG_NAME }}-*.conda
132+
133+
# Trigger GitLab dev deploy pipeline
134+
deploy-dev:
135+
runs-on: ubuntu-latest
136+
needs: build
137+
if: github.ref == 'refs/heads/next'
138+
steps:
139+
- name: Get Environment Name
140+
uses: neutrons/branch-mapper@main
141+
id: env_name
142+
with:
143+
prefix: mr_reduction
144+
145+
- name: Trigger Dev Deploy
146+
# use https://github.com/eic/trigger-gitlab-ci/pull/14 until merged
147+
uses: eic/trigger-gitlab-ci@d984d8d53d871d2fdc1325639d94322da6e8747f
148+
id: trigger
149+
with:
150+
url: https://code.ornl.gov
151+
project_id: 20403
152+
ref_name: main
153+
token: ${{ secrets.GITLAB_DEPLOY_TOKEN }}
154+
155+
- name: Annotate commit
156+
uses: peter-evans/commit-comment@v4
157+
with:
158+
body: |
159+
GitLab pipeline for ${{ steps.env_name.outputs.name }} has been submitted for this commit: ${{ steps.trigger.outputs.web_url }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Update lockfiles
2+
3+
permissions:
4+
contents: write
5+
pull-requests: write
6+
7+
on:
8+
workflow_dispatch:
9+
schedule:
10+
- cron: 0 5 1 * *
11+
12+
jobs:
13+
pixi-update:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
18+
- name: Set up pixi
19+
uses: prefix-dev/setup-pixi@v0.9.4
20+
with:
21+
run-install: false
22+
23+
- name: Update lockfiles
24+
run: |
25+
set -o pipefail
26+
pixi update --json | pixi exec pixi-diff-to-markdown >> diff.md
27+
28+
- name: Create pull request
29+
uses: peter-evans/create-pull-request@v8
30+
with:
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
commit-message: Update pixi lockfile
33+
title: Update pixi lockfile
34+
body-path: diff.md
35+
branch: update-pixi
36+
base: next
37+
labels: pixi
38+
delete-branch: true
39+
add-paths: pixi.lock

pixi.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ readme = "README.md"
1212
keywords = ["neutrons"]
1313

1414
[project.urls]
15-
homepage = "https://github.com/sns-chops/resolution"
16-
repository = "https://github.com/sns-chops/resolution"
15+
homepage = "https://github.com/neutrons/dgs-resolution"
16+
repository = "https://github.com/neutrons/dgs-resolution"
1717
# documentation = add_url_to_readthedoc_here
18-
issues = "https://github.com/sns-chops/resolution/issues"
18+
issues = "https://github.com/neutrons/dgs-resolution/issues"
1919

2020
[project.gui-scripts]
21-
resolution-ui = "dgs_resolution.app:main"
21+
dgsres-ui = "dgs_resolution.app:main"
2222

2323
####################
2424
### Build config ###
@@ -96,8 +96,8 @@ waitress = "*"
9696

9797

9898
[tool.pixi.package]
99-
name = "resolution"
100-
version = "0.0.0" # placeholder, overwritten by sync-version
99+
name = "dgs_resolution"
100+
version = "0.0.0" # placeholder, overwritten by sync-version
101101

102102
[tool.pixi.package.build]
103103
backend = { name = "pixi-build-python", version = "*" }
@@ -124,7 +124,7 @@ hatch = "*"
124124
toml-cli = "*"
125125

126126
[tool.pixi.feature.dev.dependencies]
127-
pip = ">=26.0" # CVE-2026-1703
127+
pip = ">=26.0"
128128
pip-audit = "*"
129129
pre-commit = "*"
130130
ruff = "*"
@@ -187,7 +187,7 @@ select = ["A", "ARG", "ASYNC", "BLE", "C90", "E", "F", "I", "N", "UP032", "W"]
187187
ignore = []
188188

189189
[tool.ruff.lint.isort]
190-
known-first-party = ["packagenamepy"]
190+
known-first-party = ["dgs_resolution"]
191191

192192
[tool.ruff.format]
193193
quote-style = "double"

0 commit comments

Comments
 (0)