-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testing and packaging files (#325)
Add testing and packaging files
- Loading branch information
1 parent
22f7504
commit 6fc28bd
Showing
17 changed files
with
122 additions
and
594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Workflow files stored in the default location of `.github/workflows` | ||
schedule: | ||
interval: "weekly" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: conda packaging and deployment | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [qa, main] | ||
tags: ['v*'] | ||
|
||
jobs: | ||
linux: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-update-conda: true | ||
channels: conda-forge,defaults | ||
use-mamba: true | ||
environment-file: environment.yml | ||
- name: install additional dependencies | ||
run: | | ||
echo "installing additional dependencies from environment_development.yml" | ||
- name: build conda package | ||
run: | | ||
# set up environment | ||
cd conda.recipe | ||
echo "versioningit $(versioningit ../)" | ||
# build the package | ||
VERSION=$(versioningit ../) conda mambabuild --channel conda-forge --output-folder . . | ||
conda verify noarch/drtsans*.tar.bz2 | ||
- name: upload conda package to anaconda | ||
shell: bash -l {0} | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | ||
IS_RC: ${{ contains(github.ref, 'rc') }} | ||
run: | | ||
# label is main or rc depending on the tag-name | ||
CONDA_LABEL="main" | ||
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi | ||
echo pushing ${{ github.ref }} with label $CONDA_LABEL | ||
anaconda upload --label $CONDA_LABEL conda.recipe/noarch/drtsans*.tar.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: test | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: [next, qa, main] | ||
tags: ['v*'] | ||
|
||
jobs: | ||
linux: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-update-conda: true | ||
channels: conda-forge,defaults | ||
use-mamba: true | ||
environment-file: environment.yml | ||
lfs: true | ||
submodules: recursive | ||
- name: install additional dependencies | ||
run: | | ||
echo "installing additional dependencies if cannot be installed from conda" | ||
- name: test preparation | ||
run: | | ||
python -m pip install -e . | ||
versioningit -vw | ||
git lfs pull | ||
git submodule update --init --recursive | ||
- name: run unit tests | ||
run: | | ||
echo "running unit tests" | ||
python -m pytest -m "not mount_eqsans" -vv --dist loadscope -n 2 --cov=src --cov-report=xml:unit_test_coverage.xml --cov-report=term --junitxml=unit_test_results.xml tests/unit/ | ||
- name: run integration tests | ||
run: | | ||
echo "running integration tests" | ||
python -m pytest -m "not mount_eqsans" -vv --dist loadscope -n 2 --cov=src --cov-report=xml:integration_test_coverage.xml --cov-report=term --junitxml=integration_test_results.xml tests/integration/ | ||
- name: upload coverage to codecov | ||
uses: codecov/codecov-action@v5 | ||
if: | ||
github.actor != 'dependabot[bot]' | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: | | ||
unit_test_coverage.xml | ||
integration_test_coverage.xml | ||
- name: build conda package | ||
run: | | ||
# test that the conda package builds | ||
cd conda.recipe | ||
echo "versioningit $(versioningit ../)" | ||
# conda channels could have been defined in the conda-incubator, but you can copy/paste the lines | ||
# below to build the conda package in your local machine | ||
CHANNELS="--channel mantid/label/main --channel conda-forge" | ||
VERSION=$(versioningit ../) conda mambabuild $CHANNELS --output-folder . . | ||
conda verify noarch/drtsans*.tar.bz2 |
Oops, something went wrong.