|
| 1 | +name: Compile WL function(s) |
| 2 | +on: [push] |
| 3 | +jobs: |
| 4 | + FunctionCompile-Windows-x86-64: |
| 5 | + runs-on: windows-latest |
| 6 | + env: |
| 7 | + WOLFRAM_SYSTEM_ID: Windows-x86-64 |
| 8 | + WOLFRAMENGINE_INSTALL_MSI_DOWNLOAD_URL: https://files.wolframcdn.com/packages/winget/12.2.0.0/WolframEngine_12.2.0_WIN.msi |
| 9 | + WOLFRAMENGINE_CACHE_KEY: WolframEngine-A |
| 10 | + WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY: WolframEngine |
| 11 | + steps: |
| 12 | + - name: Check out repository |
| 13 | + uses: actions/checkout@v2 |
| 14 | + |
| 15 | + - name: Cache/restore Wolfram Engine install |
| 16 | + id: cache-restore |
| 17 | + uses: actions/cache@v2 |
| 18 | + env: |
| 19 | + WOLFRAMENGINE_INSTALLATION_DIRECTORY: '${{ runner.temp }}\${{ env.WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY }}' |
| 20 | + with: |
| 21 | + path: ${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }} |
| 22 | + key: wolframengine-${{ env.WOLFRAM_SYSTEM_ID }}-${{ env.WOLFRAMENGINE_CACHE_KEY }} |
| 23 | + |
| 24 | + - name: Download and install Wolfram Engine |
| 25 | + if: steps.cache-restore.outputs.cache-hit != 'true' |
| 26 | + env: |
| 27 | + WOLFRAMENGINE_INSTALLATION_DIRECTORY: '${{ runner.temp }}\${{ env.WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY }}' |
| 28 | + WOLFRAMENGINE_INSTALL_MSI_PATH: '${{ runner.temp }}\WolframEngine-Install.msi' |
| 29 | + WOLFRAMENGINE_INSTALL_LOG_PATH: '${{ runner.temp }}\WolframEngine-Install.log' |
| 30 | + run: | |
| 31 | + echo 'Downloading Wolfram Engine installer...' |
| 32 | + $msiFile = '${{ env.WOLFRAMENGINE_INSTALL_MSI_PATH }}' |
| 33 | + $logFile = '${{ env.WOLFRAMENGINE_INSTALL_LOG_PATH }}' |
| 34 | +
|
| 35 | + Import-Module BitsTransfer |
| 36 | + Start-BitsTransfer '${{ env.WOLFRAMENGINE_INSTALL_MSI_DOWNLOAD_URL }}' $msiFile |
| 37 | + echo 'Downloaded Wolfram Engine installer.' |
| 38 | +
|
| 39 | + $DataStamp = get-date -Format yyyyMMddTHHmmss |
| 40 | + $MSIArguments = @( |
| 41 | + "/i" |
| 42 | + ('"{0}"' -f $msiFile) |
| 43 | + 'INSTALLLOCATION="${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}"' |
| 44 | + "/qn" |
| 45 | + "/norestart" |
| 46 | + "/L*v" |
| 47 | + $logFile |
| 48 | + ) |
| 49 | + echo 'Installing Wolfram Engine...' |
| 50 | + Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow |
| 51 | + echo 'Installed Wolfram Engine.' |
| 52 | +
|
| 53 | + - name: Compile function |
| 54 | + env: |
| 55 | + WOLFRAMENGINE_INSTALLATION_DIRECTORY: '${{ runner.temp }}\${{ env.WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY }}' |
| 56 | + WOLFRAMINIT: "-pwfile !cloudlm.wolfram.com -entitlement ${{ secrets.WOLFRAM_LICENSE_ENTITLEMENT_ID }}" |
| 57 | + run: | |
| 58 | + $env:Path += ';${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}\' |
| 59 | +
|
| 60 | + wolfram -script ./compile.wls |
| 61 | +
|
| 62 | + - name: Archive compiled libraries |
| 63 | + uses: actions/upload-artifact@v2 |
| 64 | + with: |
| 65 | + name: CompiledFunctionLibraries-${{ env.WOLFRAM_SYSTEM_ID }} |
| 66 | + path: | |
| 67 | + compiled/ |
| 68 | + if-no-files-found: error |
| 69 | + |
| 70 | + FunctionCompile-MacOSX-x86-64: |
| 71 | + runs-on: macos-latest |
| 72 | + env: |
| 73 | + WOLFRAM_SYSTEM_ID: MacOSX-x86-64 |
| 74 | + WOLFRAMENGINE_CACHE_KEY: WolframEngine-A |
| 75 | + WOLFRAMENGINE_INSTALLATION_DIRECTORY: "/Applications/Wolfram Engine.app" |
| 76 | + steps: |
| 77 | + - name: Check out repository |
| 78 | + uses: actions/checkout@v2 |
| 79 | + |
| 80 | + - name: Cache/restore Wolfram Engine install |
| 81 | + id: cache-restore |
| 82 | + uses: actions/cache@v2 |
| 83 | + with: |
| 84 | + path: ${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }} |
| 85 | + key: wolframengine-${{ env.WOLFRAM_SYSTEM_ID }}-${{ env.WOLFRAMENGINE_CACHE_KEY }} |
| 86 | + |
| 87 | + - name: Install Wolfram Engine |
| 88 | + if: steps.cache-restore.outputs.cache-hit != 'true' |
| 89 | + run: | |
| 90 | + echo 'Installing Wolfram Engine...' |
| 91 | + brew install --cask wolfram-engine |
| 92 | + echo 'Installed Wolfram Engine.' |
| 93 | +
|
| 94 | + - name: Compile function |
| 95 | + env: |
| 96 | + WOLFRAMENGINE_EXECUTABLES_DIRECTORY: "${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}/Contents/Resources/Wolfram Player.app/Contents/MacOS" |
| 97 | + WOLFRAMSCRIPT_ENTITLEMENTID: ${{ secrets.WOLFRAM_LICENSE_ENTITLEMENT_ID }} |
| 98 | + WOLFRAMSCRIPT_KERNELPATH: "${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}/Contents/MacOS/WolframKernel" |
| 99 | + run: | |
| 100 | + export PATH="${{ env.WOLFRAMENGINE_EXECUTABLES_DIRECTORY }}:$PATH" |
| 101 | +
|
| 102 | + wolframscript -debug -verbose -script ./compile.wls |
| 103 | +
|
| 104 | + - name: Archive compiled libraries |
| 105 | + uses: actions/upload-artifact@v2 |
| 106 | + with: |
| 107 | + name: CompiledFunctionLibraries-${{ env.WOLFRAM_SYSTEM_ID }} |
| 108 | + path: | |
| 109 | + compiled/ |
| 110 | + if-no-files-found: error |
| 111 | + |
| 112 | + FunctionCompile-Linux-x86-64: |
| 113 | + runs-on: ubuntu-latest |
| 114 | + container: |
| 115 | + image: wolframresearch/wolframengine:latest |
| 116 | + options: --user root |
| 117 | + env: |
| 118 | + WOLFRAM_SYSTEM_ID: Linux-x86-64 |
| 119 | + steps: |
| 120 | + - name: Check out repository |
| 121 | + uses: actions/checkout@v2 |
| 122 | + |
| 123 | + - name: Install build tools |
| 124 | + run: | |
| 125 | + apt-get -y update |
| 126 | + apt-get -y install build-essential |
| 127 | +
|
| 128 | + - name: Compile function |
| 129 | + env: |
| 130 | + WOLFRAMSCRIPT_ENTITLEMENTID: ${{ secrets.WOLFRAM_LICENSE_ENTITLEMENT_ID }} |
| 131 | + run: | |
| 132 | + wolframscript -script ./compile.wls |
| 133 | +
|
| 134 | + - name: Archive compiled libraries |
| 135 | + uses: actions/upload-artifact@v2 |
| 136 | + with: |
| 137 | + name: CompiledFunctionLibraries-${{ env.WOLFRAM_SYSTEM_ID }} |
| 138 | + path: | |
| 139 | + compiled/ |
| 140 | + if-no-files-found: error |
0 commit comments