Skip to content

Commit 8b9b218

Browse files
Fix GH actions (#199)
* Update micromamba action * Follow the official docs * Add init-shell: bash * Add debugging * Explicit micromamba init * Typo fix * Random fix * Update build-job.yml * Update build-job.yml * Update build-job.yml * Update build-job.yml * Starting to work on internal micromamba action * Add shell * Add a check * Install using the old method * Actually update the action * More action updates * Start reworking the flow * Syntax fix * Update 1st part of the flow * Fix output dir generation * Fix output dir --------- Co-authored-by: adam-urbanczyk <13981538+adam-urbanczyk@users.noreply.github.com>
1 parent 0ccd56a commit 8b9b218

3 files changed

Lines changed: 39 additions & 23 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'Install micromamba'
2+
runs:
3+
using: 'composite'
4+
steps:
5+
- name: install micromamba
6+
if: ${{ !contains(runner.os,'mac')}}
7+
shell: bash
8+
run: "bash <(curl -L micro.mamba.pm/install.sh) && cp ~/.local/bin/micromamba ."
9+
10+
- name: add to path
11+
if: ${{ !contains(runner.os,'mac')}}
12+
shell: bash
13+
run: echo 'PATH="${PATH}:${HOME}"' >> $GITHUB_PATH
14+
15+
- name: 'Install (MacOS)'
16+
if: contains(runner.os,'mac')
17+
shell: bash
18+
run: brew install micromamba
19+
20+
- name: 'Check installation'
21+
shell: bash
22+
run: which micromamba && micromamba info

.github/workflows/build-job.yml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
with:
3636
submodules: true
3737

38+
- uses: ./.github/actions/micromamba
39+
3840
# --- Mac SDK Hack ---
3941
- name: SDK install and symlink (Mac)
4042
if: contains(inputs.runner_generate, 'mac')
@@ -47,28 +49,19 @@ jobs:
4749
sudo ln -s /opt/MacOSX11.3.sdk/System/Library/Frameworks/OpenGL.framework/Headers /usr/local/include/OpenGL
4850
4951
# --- Setup Environment ---
50-
- uses: mamba-org/setup-micromamba@v2
51-
with:
52-
# REMOVE: environment-file: environment.devenv.yml
53-
environment-name: placeholder
54-
# cache-environment: true
55-
# Create a minimal environment with mamba-devenv
56-
create-args: >-
57-
-c conda-forge python=3.12 conda-devenv mamba
52+
- name: install conda-devenv
53+
run: micromamba install mamba conda-devenv
5854

5955
- name: Prepare conda environment (mamba-devenv)
60-
shell: bash -l {0}
6156
run: |
6257
export CONDA_DEVENV_ENV_MANAGER=mamba
63-
mamba create -n cpp-py-bindgen
64-
mamba-devenv -f environment.devenv.yml
58+
micromamba create -n cpp-py-bindgen
59+
micromamba run mamba-devenv -f environment.devenv.yml
6560
6661
- name: Read output dir
6762
id: conf
68-
shell: bash -l {0}
6963
run: |
70-
micromamba activate cpp-py-bindgen
71-
OUTPUT=`python -c'import toml; print(toml.load("ocp.toml")["output_folder"])'`
64+
OUTPUT=`micromamba run -n cpp-py-bindgen python -c'import toml; print(toml.load("ocp.toml")["output_folder"])'`
7265
echo "OUTPUT=$OUTPUT" >> $GITHUB_OUTPUT
7366
7467
- name: Restore OCP_src cache
@@ -83,11 +76,9 @@ jobs:
8376
# Windows Special Case (Running on Linux targeting Windows)
8477
- name: Generate (Windows on Linux)
8578
if: inputs.platform == 'Windows' && steps.cache-ocp-src-restore.outputs.cache-hit != 'true'
86-
shell: bash -l {0}
8779
run: |
8880
micromamba create --yes --platform win-64 --no-deps --prefix ./occt occt=7.9.2
89-
micromamba activate cpp-py-bindgen
90-
cmake -S . -B . -G Ninja \
81+
micromamba run -n cpp-py-bindgen cmake -S . -B . -G Ninja \
9182
-DPython_ROOT_DIR=$CONDA_PREFIX \
9283
-DPython3_ROOT_DIR=$CONDA_PREFIX \
9384
-DPython_FIND_VIRTUALENV=ONLY \
@@ -100,10 +91,8 @@ jobs:
10091
# Standard Case (Linux/Mac)
10192
- name: Generate (Standard)
10293
if: inputs.platform != 'Windows' && steps.cache-ocp-src-restore.outputs.cache-hit != 'true'
103-
shell: bash -l {0}
10494
run: |
105-
micromamba activate cpp-py-bindgen
106-
cmake -S . -B . -G Ninja \
95+
micromamba run -n cpp-py-bindgen cmake -S . -B . -G Ninja \
10796
-DPython_ROOT_DIR=$CONDA_PREFIX \
10897
-DPython3_ROOT_DIR=$CONDA_PREFIX \
10998
-DPython_FIND_VIRTUALENV=ONLY \
@@ -189,14 +178,19 @@ jobs:
189178
sudo tar -xf MacOSX10.15.sdk.tar.xz -C /opt
190179
191180
# --- Setup Environment ---
192-
- uses: mamba-org/setup-micromamba@v2
181+
- uses: mamba-org/setup-micromamba@v3
182+
env:
183+
ACTIONS_STEP_DEBUG: true
193184
with:
194185
# micromamba-version: '1.5.8-0'
195186
# REMOVE: environment-file: environment.devenv.yml
196187
environment-name: placeholder
197188
# Create a minimal environment with mamba-devenv
189+
init-shell: bash
198190
create-args: >-
199-
-c conda-forge python=${{ env.PYTHON_VERSION }} conda-devenv mamba
191+
python=${{ env.PYTHON_VERSION }}
192+
conda-devenv
193+
mamba
200194
201195
- name: Prepare conda environment
202196
shell: bash -l {0}

0 commit comments

Comments
 (0)