-
Notifications
You must be signed in to change notification settings - Fork 361
/
action.yml
70 lines (64 loc) · 2.7 KB
/
action.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
name: "Windows test env setup"
description: "Used to setup Windows tests environemt"
inputs:
scala-version:
description: "Scala version used in the tests"
required: true
outputs:
vcpkg-dir:
description: "Directory containing installed libraries"
value: ${{steps.resolve-env.outputs.VcpkgLibs}}
runs:
using: "composite"
steps:
# We need to set proper Pagefile limits in advance.
# Github actions default page file size is quite small,
# it's not enough to run all tests, especially when using None GC.
# We've observed that on Unix memory management is less strict,
# you can reserve more memory than it's physically possible.
# On Windows however you need to reserve/commit memory in advance -
# it does not matter whether it would be used or not, the amount of all
# reserved memory cannot exceed the amount of physically available storage.
- name: Configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.2
with:
minimum-size: 4GB
maximum-size: 16GB
#Prepare environment, clang needs to be installed
#Compilation on MSVC needs c++14 or higher and expects llvm 11.0.0 or newer
#Cache commonly used files: Coursier, ivy cache
- name: Resolve env variables
id: resolve-env
shell: pwsh
run: |
echo "::set-output name=ProgramFiles::${env:ProgramFiles}"
echo "::set-output name=LocalAppData::${env:LocalAppData}"
echo "::set-output name=UserProfile::${env:UserProfile}"
echo "::set-output name=VcpkgLibs::${env:VCPKG_INSTALLATION_ROOT}\installed\x64-windows-static"
if ("${{inputs.scala-version}}".StartsWith("2.")) {
echo ("project-version=" + ("${{inputs.scala-version}}".Split(".")[0, 1] -join "_")) >> $env:GITHUB_ENV
} else {
echo "project-version=3" >> $env:GITHUB_ENV
}
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v2
with:
path: |
${{steps.resolve-env.outputs.ProgramFiles}}\LLVM\
${{steps.resolve-env.outputs.LocalAppData}}\Coursier\Cache\v1\
${{steps.resolve-env.outputs.UserProfile}}\.ivy2\cache
key: ${{ runner.os }}-${{ inputs.scala-version }}-deps
# Install LLVM in case if cache is missing
- name: Install LLVM
shell: pwsh
run: choco install llvm --version=11.0.0 --allow-downgrade
- name: Add LLVM on Path
shell: pwsh
run: echo "${env:ProgramFiles}\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Assert clang installed and on path
shell: pwsh
run: clang --version
- name: Install libs
shell: pwsh
run: vcpkg install bdwgc zlib --triplet=x64-windows-static