Fix missing progress bar in new jupyter #725
Workflow file for this run
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
name: Test and Deploy | |
on: [push, pull_request] | |
jobs: | |
run-unit-tests: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 60 | |
name: ubuntu-22.04 python 3.9 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: 3.9 | |
channels: conda-forge | |
auto-activate-base: true | |
- name: Map the Branch Name to a Conda Environment | |
uses: neutrons/branch-mapper@modifiedMain | |
id: envname | |
with: | |
prefix: "neutron-imaging" | |
suffix-default: "-dev" | |
- name: Install dependencies | |
timeout-minutes: 60 | |
shell: bash -l {0} | |
run: | | |
python -m pip install --upgrade pip | |
# NOTE: the selected action is using packages from main, which is | |
# in compatible with those from conda-forge, a force update here | |
# help to bypass this issue. | |
conda update -n base --all -y | |
conda env update -n base --file=conda/${{ steps.envname.outputs.name }}.yml | |
conda install --yes --name base pytest | |
- name: Run tests | |
shell: bash -l {0} | |
run: | | |
cd notebooks | |
conda activate base | |
python -m pytest tests/ | |
trigger-deploy-conda-environment: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 60 | |
name: test-trigger-deploy-conda-environment | |
if: ${{ github.ref_protected }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/[email protected] | |
# Find which conda environment file we should use for the deployment | |
# branch `main` maps to `neutron-imaging` (YML file "conda/neutron-imaging.yml") | |
# branch `next` (and any other branch) maps to `neutron-imaging-dev` | |
- name: Map the Branch Name to a Conda Environment | |
uses: neutrons/branch-mapper@modifiedMain | |
id: envname | |
with: | |
prefix: "neutron-imaging" | |
suffix-default: "-dev" | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Trigger Deploy | |
id: trigger | |
env: | |
CONDAENVFILE: 'conda/${{ steps.envname.outputs.name }}.yml' | |
if: ${{ contains(steps.changed-files.outputs.all_changed_files, env.CONDAENVFILE) }} | |
uses: eic/trigger-gitlab-ci@v2 | |
with: | |
url: https://code.ornl.gov | |
token: ${{ secrets.GITLAB_TRIGGER_TOKEN_CONDA }} | |
project_id: 11833 | |
ref_name: main | |
variables: | | |
PLAY="update" | |
CONDA_ENV="${{ steps.envname.outputs.name }}" | |
CONDA_ENV_SOURCE="https://raw.githubusercontent.com/neutronimaging/python_notebooks/${{ steps.extract_branch.outputs.branch }}/conda/${{ steps.envname.outputs.name }}.yml" | |
- name: Annotate commit | |
if: ${{ steps.trigger.conclusion == 'success' }} | |
uses: peter-evans/commit-comment@v2 | |
with: | |
body: | | |
GitLab pipeline with CONDA_ENV=${{ steps.conda_env_name.outputs.name }} submitted for commit ${{ steps.trigger.outputs.web_url }} | |
trigger-deploy-notebooks: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 60 | |
# only trigger deploys from protected branches | |
if: ${{ github.ref_protected}} | |
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@v2 | |
with: | |
body: | | |
GitLab pipeline with NOTEBOOK_COLLECTION_NAME=${{ steps.notebook_collection.outputs.name }} submitted for commit ${{ steps.trigger.outputs.web_url }} |