forked from stack-of-tasks/pinocchio
-
Notifications
You must be signed in to change notification settings - Fork 1
128 lines (110 loc) · 3.3 KB
/
windows-conda.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: CI - Windows via Conda
on:
push:
paths-ignore:
- doc/**
- .gitlab-ci.yml
- .gitignore
- '*.md'
- CITATION.*
- COPYING.LESSER
- colcon.pkg
- .pre-commit-config.yaml
pull_request:
paths-ignore:
- doc/**
- .gitlab-ci.yml
- .gitignore
- '*.md'
- CITATION.*
- COPYING.LESSER
- colcon.pkg
- .pre-commit-config.yaml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.os }} - ${{ matrix.compiler }} with Conda
runs-on: ${{ matrix.os }}
env:
CCACHE_BASEDIR: ${GITHUB_WORKSPACE}
CCACHE_DIR: ${GITHUB_WORKSPACE}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 5
strategy:
fail-fast: false
matrix:
os: [windows-2019]
compiler: [cl, clang-cl]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/cache@v4
with:
path: .ccache
save-always: true
key: ccache-windows-conda-${{ matrix.compiler }}-${{ matrix.os }}-${{ github.sha }}
restore-keys: ccache-windows-conda-${{ matrix.compiler }}-${{ matrix.os }}-
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: pinocchio
auto-update-conda: true
environment-file: .github/workflows/conda/environment_windows.yml
python-version: '3.10'
auto-activate-base: false
- name: Get Compilation Flags
id: get_labels
uses: actions/github-script@v7
with:
script: |
const script = require('./.github/workflows/scripts/get_label.js');
await script({github, context, core})
result-encoding: string
- name: Build Pinocchio
shell: cmd /C CALL {0}
run: |
:: Set compiler to use.
:: This must be done here and not in env since
:: cxx-compiler activation script set this variable
:: and is called before.
set CC=${{ matrix.compiler }}.exe
set CXX=${{ matrix.compiler }}.exe
echo Compiler set to: %CC%
call conda list
:: Create build directory
mkdir build
pushd build
:: Configure (Ninja use CC and CXX to determine the compiler)
cmake ^
-G "Ninja" ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache ^
-DCMAKE_BUILD_TYPE=Release ^
${{ steps.get_labels.outputs.cmakeFlags }} ^
..
:: Build
cmake --build . -j2
if errorlevel 1 exit 1
:: Testing
ctest --output-on-failure
if errorlevel 1 exit 1
:: Install
cmake --install .
:: Test Python import
cd ..
python -c "import pinocchio"
if errorlevel 1 exit 1
check:
if: always()
name: check-windows-conda
needs:
- build
runs-on: Ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}