forked from perspective-dev/perspective
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
247 lines (217 loc) · 10.3 KB
/
action.yaml
File metadata and controls
247 lines (217 loc) · 10.3 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
# ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
# ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
# ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
# ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
# ┃ Copyright (c) 2017, the Perspective Authors. ┃
# ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
# ┃ This file is part of the Perspective library, distributed under the terms ┃
# ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
name: "Install Dependencies"
description: "Install and cache the project's myraid dependencies"
inputs:
javascript:
default: "true"
description: "Install pnpm postinstall steps, playwright browsers and emsdk?"
arch:
default: ""
description: "Architecture"
manylinux:
default: "false"
description: "Deal with manylinux exceptions"
cpp:
default: "true"
description: "Install Boost and LLVM?"
rust:
default: "true"
description: "Install Rust toolchain?"
python:
default: "true"
description: "Install Python dependencies?"
playwright:
default: "false"
description: "Install browsers for playwright testing"
clean:
default: "false"
description: "Clean unused deps. This is helpful if we run out of HD but slow!"
skip_cache:
default: "false"
description: "Don't use cache from previous builds"
outputs:
VCPKG_INSTALLATION_ROOT:
description: "The output of vcpkg install path"
value: ${{ steps.vcpkg-step.outputs.VCPKG_INSTALLATION_ROOT }}
runs:
using: "composite"
steps:
- name: Clean System
uses: AdityaGarg8/remove-unwanted-software@v4.1
if: ${{ inputs.clean == 'true' && runner.os != 'Windows' }}
with:
remove-android: "true"
remove-dotnet: "true"
remove-haskell: "true"
remove-codeql: "true"
# https://github.com/open-telemetry/opentelemetry-cpp/issues/2998
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: "3.29.6"
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Setup emsdk cache
uses: actions/cache@v4
id: emsdk-cache
if: ${{ inputs.skip_cache == 'false' && inputs.javascript == 'true' }}
with:
path: |
~/boost_1_82_0/
~/.emsdk/
~/.llvm/
key: ${{ runner.os }}-emsdk-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-emsdk-
- name: Setup pip cache
uses: actions/cache@v4
if: ${{ inputs.skip_cache == 'false' && inputs.python == 'true' }}
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Setup cargo cache
uses: actions/cache@v4
if: ${{ inputs.skip_cache == 'false' && inputs.rust == 'true' }}
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
restore-keys: |
${{ runner.os }}-cargo-
# - name: ccache
# uses: hendrikmuhs/ccache-action@v1.2
# if: ${{ inputs.skip_cache == 'false' }}
# with:
# key: ${{ github.job }}-${{ matrix.os }}
- name: Windows init steps (vc143)
id: vcpkg-step
shell: pwsh
run: |
vcpkg.exe install boost-thread boost-algorithm boost-filesystem boost-multi-index boost-multiprecision boost-program-options boost-system boost-unordered boost-uuid
vcpkg.exe integrate install
echo "VCPKG_INSTALLATION_ROOT=${env:VCPKG_INSTALLATION_ROOT}"
echo "VCPKG_INSTALLATION_ROOT=${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_OUTPUT
echo "${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_PATH
echo "VCPKG_ROOT=${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_ENV
dir env:
env:
PYTHON_VERSION: ${{ matrix.python-version }}
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_PLATFORM_TOOLSET: v143
if: ${{ runner.os == 'Windows' && inputs.cpp == 'true' }}
# https://github.com/apache/arrow/issues/38391
- if: ${{ runner.os == 'macOS' }}
shell: bash
run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)" >> $GITHUB_ENV
# Use python 3.9 from manylinu
- run: echo "/opt/python/cp39-cp39/bin" >> $GITHUB_PATH
shell: bash
if: ${{ runner.os == 'Linux' }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
if: ${{ inputs.python == 'true' && runner.os != 'Linux' }}
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
# - run: |
# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
# python get-pip.py --ignore-installed
# pip debug --verbose
# shell: bash
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Install rust
uses: dtolnay/rust-toolchain@nightly
if: ${{ inputs.rust == 'true' && inputs.arch != 'aarch64' }}
with:
toolchain: nightly-2024-08-29
targets: wasm32-unknown-unknown
components: rustfmt, clippy, rust-src
- name: Install rust (aarch64 OSX)
uses: dtolnay/rust-toolchain@nightly
if: ${{ inputs.rust == 'true' && inputs.arch == 'aarch64' && runner.os == 'macOS' }}
with:
toolchain: nightly-2024-08-29
targets: aarch64-apple-darwin
components: rustfmt, clippy, rust-src
- name: Install rust (aarch64 Linux)
uses: dtolnay/rust-toolchain@nightly
if: ${{ inputs.rust == 'true' && inputs.arch == 'aarch64' && runner.os == 'Linux' }}
with:
toolchain: nightly-2024-08-29
targets: aarch64-unknown-linux-gnu
components: rustfmt, clippy, rust-src
# # TODO doesn't work.
# - name: Install LLVM 17
# if: ${{ inputs.cpp == 'true' }}
# uses: KyleMayes/install-llvm-action@v2
# with:
# version: "17"
# directory: "./.llvm"
# cached: true
- name: Install JS dependencies
shell: bash
if: ${{ inputs.javascript == 'true' && inputs.playwright == 'true' }}
run: pnpm install
- name: Install JS dependencies
shell: bash
if: ${{ inputs.javascript == 'false' || inputs.playwright == 'false'}}
run: pnpm install --ignore-scripts
- name: Install Python dependencies
shell: bash
if: ${{ inputs.python == 'true' && inputs.manylinux == 'false' }}
run: python -m pip install -r rust/perspective-python/requirements.txt
- name: Install Python dependencies
shell: bash
if: ${{ inputs.python == 'true' && inputs.manylinux == 'true' }}
run: /opt/python/cp39-cp39/bin/python -m pip install -r rust/perspective-python/requirements.txt
- name: manylinux deps
shell: bash
run: |
if [ -x "$(command -v dnf)" ]; then
dnf install wget -y
fi
if: ${{ runner.os == 'Linux' && inputs.cpp == 'true' && inputs.javascript == 'false' }}
- name: Install Python Pyodide dependencies
shell: bash
run: python -m pip install -r rust/perspective-python/requirements-pyodide.txt
if: ${{ inputs.pyodide == 'true' }}
- name: Install Pyodide distribution
shell: bash
run: pnpm run install_pyodide
if: ${{ inputs.pyodide == 'true' }}
- name: Install Python Playwright browsers
shell: bash
run: python -m playwright install
if: ${{ inputs.pyodide == 'true' }}
# - name: Install CCache
# shell: bash
# run: sudo apt install -y ccache
# if: ${{ runner.os == 'Linux' }}
# Arrow cannot install on windows without this
# https://stackoverflow.com/questions/22575662/filename-too-long-in-git-for-windows
# https://github.com/orgs/community/discussions/26952
- run: git config --system core.longpaths true
shell: pwsh
if: ${{ runner.os == 'Windows' }}