-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (123 loc) · 5.19 KB
/
compile-wl-functions.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
129
130
131
132
133
134
135
136
137
138
139
140
name: Compile WL function(s)
on: [push]
jobs:
FunctionCompile-Windows-x86-64:
runs-on: windows-latest
env:
WOLFRAM_SYSTEM_ID: Windows-x86-64
WOLFRAMENGINE_INSTALL_MSI_DOWNLOAD_URL: https://files.wolframcdn.com/packages/winget/12.2.0.0/WolframEngine_12.2.0_WIN.msi
WOLFRAMENGINE_CACHE_KEY: WolframEngine-A
WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY: WolframEngine
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Cache/restore Wolfram Engine install
id: cache-restore
uses: actions/cache@v2
env:
WOLFRAMENGINE_INSTALLATION_DIRECTORY: '${{ runner.temp }}\${{ env.WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY }}'
with:
path: ${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}
key: wolframengine-${{ env.WOLFRAM_SYSTEM_ID }}-${{ env.WOLFRAMENGINE_CACHE_KEY }}
- name: Download and install Wolfram Engine
if: steps.cache-restore.outputs.cache-hit != 'true'
env:
WOLFRAMENGINE_INSTALLATION_DIRECTORY: '${{ runner.temp }}\${{ env.WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY }}'
WOLFRAMENGINE_INSTALL_MSI_PATH: '${{ runner.temp }}\WolframEngine-Install.msi'
WOLFRAMENGINE_INSTALL_LOG_PATH: '${{ runner.temp }}\WolframEngine-Install.log'
run: |
echo 'Downloading Wolfram Engine installer...'
$msiFile = '${{ env.WOLFRAMENGINE_INSTALL_MSI_PATH }}'
$logFile = '${{ env.WOLFRAMENGINE_INSTALL_LOG_PATH }}'
Import-Module BitsTransfer
Start-BitsTransfer '${{ env.WOLFRAMENGINE_INSTALL_MSI_DOWNLOAD_URL }}' $msiFile
echo 'Downloaded Wolfram Engine installer.'
$DataStamp = get-date -Format yyyyMMddTHHmmss
$MSIArguments = @(
"/i"
('"{0}"' -f $msiFile)
'INSTALLLOCATION="${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}"'
"/qn"
"/norestart"
"/L*v"
$logFile
)
echo 'Installing Wolfram Engine...'
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow
echo 'Installed Wolfram Engine.'
- name: Compile function
env:
WOLFRAMENGINE_INSTALLATION_DIRECTORY: '${{ runner.temp }}\${{ env.WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY }}'
WOLFRAMINIT: "-pwfile !cloudlm.wolfram.com -entitlement ${{ secrets.WOLFRAM_LICENSE_ENTITLEMENT_ID }}"
run: |
$env:Path += ';${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}\'
wolfram -script ./compile.wls
- name: Archive compiled libraries
uses: actions/upload-artifact@v2
with:
name: CompiledFunctionLibraries-${{ env.WOLFRAM_SYSTEM_ID }}
path: |
compiled/
if-no-files-found: error
FunctionCompile-MacOSX-x86-64:
runs-on: macos-latest
env:
WOLFRAM_SYSTEM_ID: MacOSX-x86-64
WOLFRAMENGINE_CACHE_KEY: WolframEngine-A
WOLFRAMENGINE_INSTALLATION_DIRECTORY: "/Applications/Wolfram Engine.app"
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Cache/restore Wolfram Engine install
id: cache-restore
uses: actions/cache@v2
with:
path: ${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}
key: wolframengine-${{ env.WOLFRAM_SYSTEM_ID }}-${{ env.WOLFRAMENGINE_CACHE_KEY }}
- name: Install Wolfram Engine
if: steps.cache-restore.outputs.cache-hit != 'true'
run: |
echo 'Installing Wolfram Engine...'
brew install --cask wolfram-engine
echo 'Installed Wolfram Engine.'
- name: Compile function
env:
WOLFRAMENGINE_EXECUTABLES_DIRECTORY: "${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}/Contents/Resources/Wolfram Player.app/Contents/MacOS"
WOLFRAMSCRIPT_ENTITLEMENTID: ${{ secrets.WOLFRAM_LICENSE_ENTITLEMENT_ID }}
WOLFRAMSCRIPT_KERNELPATH: "${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}/Contents/MacOS/WolframKernel"
run: |
export PATH="${{ env.WOLFRAMENGINE_EXECUTABLES_DIRECTORY }}:$PATH"
wolframscript -debug -verbose -script ./compile.wls
- name: Archive compiled libraries
uses: actions/upload-artifact@v2
with:
name: CompiledFunctionLibraries-${{ env.WOLFRAM_SYSTEM_ID }}
path: |
compiled/
if-no-files-found: error
FunctionCompile-Linux-x86-64:
runs-on: ubuntu-latest
container:
image: wolframresearch/wolframengine:latest
options: --user root
env:
WOLFRAM_SYSTEM_ID: Linux-x86-64
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Install build tools
run: |
apt-get -y update
apt-get -y install build-essential
- name: Compile function
env:
WOLFRAMSCRIPT_ENTITLEMENTID: ${{ secrets.WOLFRAM_LICENSE_ENTITLEMENT_ID }}
run: |
wolframscript -script ./compile.wls
- name: Archive compiled libraries
uses: actions/upload-artifact@v2
with:
name: CompiledFunctionLibraries-${{ env.WOLFRAM_SYSTEM_ID }}
path: |
compiled/
if-no-files-found: error