Skip to content

Commit 0ebb4cc

Browse files
authored
Only run Ubuntu arm Emscripten job in PRs (#895)
1 parent d9ddf43 commit 0ebb4cc

1 file changed

Lines changed: 23 additions & 14 deletions

File tree

.github/workflows/emscripten.yml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jobs:
2828
llvm_targets_to_build: "WebAssembly"
2929
emsdk_ver: "4.0.9"
3030
build_static_library: On
31-
micromamba_shell_init: bash
31+
micromamba_shell_init: bash
32+
run-in-prs: true
3233
- name: osx26-arm-clang-repl-21-emscripten
3334
os: macos-26
3435
clang-runtime: '21'
@@ -56,16 +57,20 @@ jobs:
5657

5758
steps:
5859
- uses: actions/checkout@v6
60+
if: ${{ !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
5961

6062
- name: Set up Python
63+
if: ${{ !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
6164
uses: actions/setup-python@v6
6265
with:
6366
python-version: '3.11'
6467

6568
- name: Save PR Info
69+
if: ${{ !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
6670
uses: ./.github/actions/Miscellaneous/Save_PR_Info
6771

6872
- name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build (Unix like systems emscripten)
73+
if: ${{ !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
6974
uses: actions/cache/restore@v4
7075
id: cache
7176
with:
@@ -75,23 +80,25 @@ jobs:
7580
key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-clang-${{ matrix.clang-runtime }}.x-emscripten
7681

7782
- name: Setup emsdk
83+
if: ${{ !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
7884
run: |
7985
git clone --depth=1 https://github.com/emscripten-core/emsdk.git
8086
cd emsdk
8187
./emsdk install ${{ matrix.emsdk_ver }}
8288
8389
- name: Setup default Build Type
90+
if: ${{ !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
8491
uses: ./.github/actions/Miscellaneous/Select_Default_Build_Type
8592

8693
- name: Install deps on Windows
87-
if: ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }}
94+
if: ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
8895
run: |
8996
choco install findutils ninja
9097
$env:PATH="C:\Program Files (x86)\GnuWin32\bin;$env:PATH"
9198
$env:PATH="C:\Program Files (x86)\Ninja\bin;$env:PATH"
9299
93100
- name: Install deps on MacOS
94-
if: ${{ runner.os == 'macOS' && steps.cache.outputs.cache-hit != 'true' }}
101+
if: ${{ runner.os == 'macOS' && steps.cache.outputs.cache-hit != 'true' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
95102
run: |
96103
brew update
97104
export ARCHITECHURE=$(uname -m)
@@ -106,7 +113,7 @@ jobs:
106113
brew install ninja
107114
108115
- name: Install deps on Linux
109-
if: ${{ runner.os == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
116+
if: ${{ runner.os == 'Linux' && steps.cache.outputs.cache-hit != 'true' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
110117
run: |
111118
# Install deps
112119
sudo apt-get update
@@ -115,7 +122,7 @@ jobs:
115122
sudo apt-get clean
116123
117124
- name: Build LLVM/Cling on Unix systems if the cache is invalid (emscripten)
118-
if: ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' }}
125+
if: ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
119126
run: |
120127
./emsdk/emsdk activate ${{matrix.emsdk_ver}}
121128
source ./emsdk/emsdk_env.sh
@@ -220,7 +227,7 @@ jobs:
220227
221228
222229
- name: Build LLVM/Cling on Windows systems if the cache is invalid (emscripten)
223-
if: ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }}
230+
if: ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true)}}
224231
run: |
225232
.\emsdk\emsdk activate ${{matrix.emsdk_ver}}
226233
.\emsdk\emsdk_env.ps1
@@ -355,31 +362,33 @@ jobs:
355362
}
356363
357364
- name: Cache LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build
365+
if: ${{ steps.cache.outputs.cache-hit != 'true' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
358366
uses: actions/cache/save@v4
359-
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
360367
with:
361368
path: |
362369
llvm-project
363370
${{ matrix.cling=='On' && 'cling' || '' }}
364371
key: ${{ steps.cache.outputs.cache-primary-key }}
365372

366373
- name: install mamba
374+
if: ${{ !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
367375
uses: mamba-org/setup-micromamba@main
368376
with:
369377
init-shell: >-
370378
${{ matrix.micromamba_shell_init }}
371379
372380
- name: micromamba shell hook
373-
if: runner.os == 'Windows'
381+
if: ${{ runner.os == 'Windows' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
374382
shell: powershell
375383
run: |
376384
micromamba shell hook -s cmd.exe --root-prefix C:\Users\runneradmin\micromamba-root
377385
378386
- name: Build and test CppInterOp
387+
if: ${{ !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
379388
uses: ./.github/actions/Build_and_Test_CppInterOp
380389

381390
- name: Build xeus-cpp on Unix Systems
382-
if: ${{ runner.os != 'windows' }}
391+
if: ${{ runner.os != 'windows' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
383392
shell: bash -l {0}
384393
run: |
385394
./emsdk/emsdk activate ${{matrix.emsdk_ver}}
@@ -403,7 +412,7 @@ jobs:
403412
emmake make -j ${{ env.ncpus }} install
404413
405414
- name: Build xeus-cpp on Windows systems
406-
if: ${{ runner.os == 'windows' }}
415+
if: ${{ runner.os == 'windows' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
407416
shell: powershell
408417
run: |
409418
.\emsdk\emsdk activate ${{matrix.emsdk_ver}}
@@ -427,7 +436,7 @@ jobs:
427436
emmake make -j ${{ env.ncpus }} install
428437
429438
- name: Test xeus-cpp C++ Emscripten on Unix Systems
430-
if: ${{ runner.os != 'windows' }}
439+
if: ${{ runner.os != 'windows' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
431440
shell: bash -l {0}
432441
run: |
433442
set -e
@@ -436,7 +445,7 @@ jobs:
436445
node test_xeus_cpp.js
437446
438447
- name: Test xeus-cpp C++ Emscripten on Windows Systems
439-
if: ${{ runner.os == 'windows' }}
448+
if: ${{ runner.os == 'windows' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
440449
shell: powershell
441450
run: |
442451
function Error-OnFailure {
@@ -460,7 +469,7 @@ jobs:
460469
Error-OnFailure { emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html }
461470
462471
- name: Jupyter Lite integration
463-
if: ${{ runner.os != 'windows' }}
472+
if: ${{ runner.os != 'windows' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true) }}
464473
shell: bash -l {0}
465474
run: |
466475
cd ./xeus-cpp/
@@ -469,7 +478,7 @@ jobs:
469478
jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }} --contents notebooks/xeus-cpp-lite-demo.ipynb --contents notebooks/tinyraytracer.ipynb --contents notebooks/images/marie.png --contents notebooks/audio/audio.wav --output-dir dist
470479
471480
- name: Jupyter Lite integration
472-
if: ${{ runner.os == 'windows' }}
481+
if: ${{ runner.os == 'windows' && !(github.event_name == 'pull_request' && matrix.run-in-prs != true)}}
473482
shell: powershell
474483
run: |
475484
cd .\xeus-cpp\

0 commit comments

Comments
 (0)