Skip to content

Commit 30bf465

Browse files
authored
[ci] Reduce repetition (#63)
Fixes #42.
1 parent 06218f5 commit 30bf465

File tree

1 file changed

+32
-44
lines changed

1 file changed

+32
-44
lines changed

.github/workflows/main.yml

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
unix:
17+
build:
1818

1919
runs-on: ${{ matrix.os }}
2020

@@ -32,6 +32,8 @@ jobs:
3232
os: macos-13
3333
- name: osx14-arm
3434
os: macos-14
35+
- name: Windows22
36+
os: windows-2022
3537

3638
steps:
3739
- uses: actions/checkout@v3
@@ -42,12 +44,30 @@ jobs:
4244
environment-file: environment-dev.yml
4345
environment-name: xeus-cpp
4446

47+
- name: micromamba shell hook
48+
if: ${{ runner.os == 'windows' }}
49+
shell: powershell
50+
run: |
51+
micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba-root
52+
4553
- name: install cxx compiler
54+
if: ${{ runner.os != 'windows' }}
4655
shell: bash -l {0}
4756
run: |
4857
$HOME/micromamba-bin/micromamba install cxx-compiler -c conda-forge -y
4958
59+
60+
- name: cmake configure
61+
if: ${{ runner.os == 'windows' }}
62+
shell: cmd
63+
run: |
64+
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
65+
mkdir -p build
66+
cd build
67+
cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DXEUS_BUILD_TESTS=ON -DDEPENDENCY_SEARCH_PREFIX="%CONDA_PREFIX%\Library" -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" -DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%"
68+
5069
- name: cmake configure
70+
if: ${{ runner.os != 'windows' }}
5171
shell: bash -l {0}
5272
run: |
5373
mkdir -p build
@@ -58,26 +78,32 @@ jobs:
5878
-DXEUS_CPP_ENABLE_CODE_COVERAGE=${{ matrix.coverage }} \
5979
${{ matrix.extra_cmake_flags }}
6080
61-
- name: build
62-
shell: bash -l {0}
81+
- name: build & install
82+
if: ${{ runner.os == 'windows' }}
83+
shell: cmd
6384
run: |
85+
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
6486
cd build
65-
make -j8
87+
set CL=/MP
88+
nmake install
6689
67-
- name: install
90+
- name: build & install
91+
if: ${{ runner.os != 'windows' }}
6892
shell: bash -l {0}
6993
run: |
7094
cd build
71-
make install
95+
make install -j 8
7296
7397
- name: Test xeus-cpp C++
98+
if: ${{ runner.os != 'windows' }}
7499
shell: bash -l {0}
75100
run: |
76101
cd build/test
77102
./test_xeus_cpp
78103
timeout-minutes: 4
79104

80105
- name: test
106+
if: ${{ runner.os != 'windows' }}
81107
shell: bash -l {0}
82108
run: |
83109
cd test
@@ -109,44 +135,6 @@ jobs:
109135
uses: mxschmitt/action-tmate@v3
110136
# When debugging increase to a suitable value!
111137
timeout-minutes: 30
112-
win:
113-
114-
runs-on: ${{ matrix.os }}
115-
116-
strategy:
117-
fail-fast: false
118-
matrix:
119-
os: [ windows-2022]
120-
121-
steps:
122-
- uses: actions/checkout@v3
123-
124-
- name: install mamba
125-
uses: mamba-org/provision-with-micromamba@main
126-
with:
127-
environment-file: environment-dev.yml
128-
environment-name: xeus-cpp
129-
130-
- name: micromamba shell hook
131-
shell: powershell
132-
run: |
133-
micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba-root
134-
135-
- name: cmake configure
136-
shell: cmd
137-
run: |
138-
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
139-
mkdir -p build
140-
cd build
141-
cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DXEUS_BUILD_TESTS=ON -DDEPENDENCY_SEARCH_PREFIX="%CONDA_PREFIX%\Library" -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" -DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%"
142-
143-
- name: build
144-
shell: cmd
145-
run: |
146-
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
147-
cd build
148-
set CL=/MP
149-
nmake install
150138

151139
emscripten_wasm:
152140

0 commit comments

Comments
 (0)