Skip to content

Commit

Permalink
Setup conda using github action for postbuild tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbrittain committed Sep 13, 2024
1 parent 8c293ba commit 860fdff
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 11 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,20 @@ jobs:
yarn build
yarn package
# only publish builds if they pass post-build tests
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: build
miniforge-version: latest
auto-update-conda: true
python-version: 3.12
use-mamba: true
- name: postbuild-tests
working-directory: ./electron-app
shell: bash
run: |
conda init
source ~/.bashrc
./run_postbuild_tests.sh
- name: Build distributables
working-directory: ./electron-app
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/postbuildchecks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,32 @@ jobs:
- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: "126.0.6478.185"
- name: Set up Python
uses: actions/setup-python@v5
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.12"
activate-environment: build
miniforge-version: latest
auto-update-conda: true
auto-activate-base: true
python-version: 3.12
use-mamba: true
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v2
- name: install MacOS (M1) build dependencies
shell: bash
shell: bash -el {0} # required to sustain the conda environment
run: |
if [ "$RUNNER_OS" == "macOS" ] && [ "$RUNNER_ARCH" == "ARM64" ]; then
brew install pango
fi
# setuptools needs to be available globally for the yarn build script
- name: Install setuptools
shell: bash -el {0} # required to sustain the conda environment
run: |
python -m pip install --upgrade pip
python -m pip install setuptools
- name: build
working-directory: ./electron-app
shell: bash
shell: bash -el {0} # required to sustain the conda environment
run: |
corepack enable
./build_deps.sh
Expand All @@ -56,7 +62,7 @@ jobs:
yarn build
yarn package
- name: install docker MacOS (Intel chips)
shell: bash
shell: bash -el {0} # required to sustain the conda environment
run: |
if [ "$RUNNER_OS" == "macOS" ] && [ "$RUNNER_ARCH" == "X64" ]; then
brew install docker
Expand All @@ -68,6 +74,6 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: postbuild-tests
working-directory: ./electron-app
shell: bash
shell: bash -el {0} # required to sustain the conda environment
run: |
./run_postbuild_tests.sh
14 changes: 11 additions & 3 deletions .github/workflows/publish_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,21 @@ jobs:
- name: tmate debugging
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
# only publish builds if they pass post-build tests
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: build
miniforge-version: latest
auto-update-conda: true
python-version: 3.12
use-mamba: true
- name: postbuild-tests
working-directory: ./electron-app
shell: bash
# 'yarn package' is only run to allow build_testsuite.sh to run before
# the package is pushed for publishing ('yarn run publish' builds and
# publishes in one step)
run: |
conda init
source ~/.bashrc
yarn package
./run_postbuild_tests.sh
- name: publish
Expand Down
3 changes: 3 additions & 0 deletions electron-app/postbuild_tests/modules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,8 @@ describe('modules', () => {
])(
"Build and Test the conda workflow: module '%s'",
async (modulenames, connections, outfiles) => {
console.log('::: test Build and Test the conda workflow');

// Open settings pane
await driver.findElement(By.xpath('//div[@id="btnSidenavSettings"]')).click();

Expand All @@ -627,6 +629,7 @@ describe('modules', () => {

// Build and run workflow
await BuildAndRun_MultiModuleWorkflow(driver, modulenames, connections, outfiles);
console.log('<<< test Build and Test the conda workflow');
},
5 * ONE_MINUTE,
); // long timeout
Expand Down
2 changes: 1 addition & 1 deletion electron-app/run_postbuild_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUNNER_OS=${RUNNER_OS:-$(uname)}
# install miniforge if not already installed
if ! command -v mamba &> /dev/null
then
. ./install_miniforge.sh
source ./install_miniforge.sh
fi

# launch GRAPEVNE in the background and in debug mode
Expand Down

0 comments on commit 860fdff

Please sign in to comment.