-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from mantidproject/add_publish_workflow
Add nightly workflow to publish mvesuvio
- Loading branch information
Showing
4 changed files
with
117 additions
and
2 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,37 @@ | ||
name: Build and upload conda package | ||
|
||
inputs: | ||
repository: | ||
description: 'Anaconda repository' | ||
required: true | ||
default: 'mantid' | ||
label: | ||
description: 'Label' | ||
required: false | ||
default: 'nightly' | ||
token: | ||
description: 'Anaconda API Token' | ||
required: true | ||
|
||
description: Build and upload conda package | ||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Make build-env | ||
shell: bash -l {0} | ||
run: | | ||
conda config --set always_yes yes --set changeps1 no | ||
conda create -n build-env python=3.8.* | ||
conda activate build-envn | ||
mamba install -c conda-forge mamba conda-build anaconda-client conda-verify | ||
conda config --add channels mantid | ||
conda config --add channels mantid/label/nightly | ||
- name: Build package | ||
shell: bash -l {0} | ||
run: | | ||
conda activate build-env | ||
conda config --set anaconda_upload yes | ||
conda build --user ${{ inputs.repository }} --token ${{ inputs.token }} --label ${{ inputs.label }} $GITHUB_WORKSPACE/conda |& tee upload.log | ||
grep "Upload complete" upload.log |
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,37 @@ | ||
name: mvesuvio nightly build | ||
|
||
on: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
|
||
jobs: | ||
test: | ||
runs-on: self-hosted | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Checkout mvesuvio | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Miniconda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
miniforge-version: latest | ||
miniforge-variant: Mambaforge | ||
activate-environment: mvesuvio-env | ||
environment-file: environment.yml | ||
auto-activate-base: false | ||
|
||
# Runs Unit tests | ||
- name: Run mvesuvio analysis unit tests | ||
run: | | ||
export MANTIDPROPERTIES=$(pwd)/Mantid.user.properties | ||
python -m unittest discover -s ./EVSVesuvio/vesuvio_analysis/tests | ||
# Runs System tests | ||
- name: Run mvesuvio analysis system tests | ||
run: | | ||
export VESUVIOPROPERTIES=$(pwd)/EVSVesuvio/system_tests/test_config/vesuvio.user.properties | ||
python -m unittest discover -s ./EVSVesuvio/system_tests |
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,42 @@ | ||
name: Deploy mvesuvio nightly | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["mvesuvio nightly build"] | ||
branches: [main] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
build_conda_and_upload: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Checkout mvesuvio | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
|
||
- name: Check for changes since last build | ||
run: | | ||
echo "recentCommits=$(test -z $(git log --since="yesterday" -1 --format=%h) && echo false || echo true)" >> $GITHUB_ENV | ||
- name: Setup Miniconda | ||
if: ${{ env.recentCommits == 'true'}} | ||
uses: conda-incubator/[email protected] | ||
with: | ||
miniforge-version: latest | ||
miniforge-variant: Mambaforge | ||
activate-environment: vesuvio-env | ||
environment-file: environment.yml | ||
auto-activate-base: false | ||
|
||
- name: Build mvesuvio nightly conda package | ||
if: ${{ env.recentCommits == 'true'}} | ||
uses: ./.github/actions/publish-package | ||
with: | ||
label: nightly | ||
token: ${{ secrets.ANACONDA_API_TOKEN }} |
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