-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
91 lines (88 loc) · 3.21 KB
/
win.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
name: Windows CI
on: [push, pull_request]
jobs:
linux-job:
runs-on: ubuntu-latest
container: crystallang/crystal:0.33.0
steps:
- name: Download Crystal source
uses: actions/checkout@v2
- name: Install LLVM
run: |
apt-get -q update; apt-get -qy install llvm-8-dev
- name: Build Crystal
run: |
make
- name: Cross-compile stdlib specs
run: |
bin/crystal build --cross-compile --target x86_64-pc-windows-msvc --exclude-warnings spec/std spec/std_spec.cr -Dwithout_zlib -Dwithout_openssl
- name: Upload compiled object
uses: actions/upload-artifact@v1
with:
name: objs
path: std_spec.o
windows-job:
needs: linux-job
runs-on: windows-latest
steps:
- name: Disable CRLF line ending substitution
run: |
git config --global core.autocrlf false
- name: Download Crystal source
uses: actions/checkout@v2
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@1eed9c12159dd2d2f8804980fbba1abe36ff77d2
- name: Cache libraries
id: cache-libs
uses: actions/cache@v1
with:
path: libs
key: win-libs-${{ hashFiles('.github/workflows/win.yml') }}
- name: Download libgc
if: steps.cache-libs.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: ivmai/bdwgc
ref: 2fd48a92b8bff3afb64b3528ad78b63f033f0436 # master @ 2020-02-13
path: bdwgc
- name: Download libatomic_ops
if: steps.cache-libs.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: ivmai/libatomic_ops
ref: v7.6.10
path: bdwgc/libatomic_ops
- name: Build libgc
if: steps.cache-libs.outputs.cache-hit != 'true'
working-directory: ./bdwgc
run: |
cmake . -G "Visual Studio 16 2019" -DBUILD_SHARED_LIBS=OFF -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
cmake --build . --config Release
- name: Download libpcre
if: steps.cache-libs.outputs.cache-hit != 'true'
run: |
iwr https://ftp.pcre.org/pub/pcre/pcre-8.43.zip -OutFile pcre.zip
Expand-Archive pcre.zip -DestinationPath .
mv pcre* pcre
- name: Build libpcre
if: steps.cache-libs.outputs.cache-hit != 'true'
working-directory: ./pcre
run: |
cmake . -G "Visual Studio 16 2019" -DBUILD_SHARED_LIBS=OFF -DPCRE_SUPPORT_UNICODE_PROPERTIES=ON -DPCRE_SUPPORT_JIT=ON -DPCRE_STATIC_RUNTIME=ON
cmake --build . --config Release
- name: Gather libraries
if: steps.cache-libs.outputs.cache-hit != 'true'
run: |
mkdir libs
mv pcre/Release/pcre.lib libs/
mv bdwgc/Release/gc.lib libs/
- name: Download compiled object
uses: actions/download-artifact@v1
with:
name: objs
- name: Link stdlib spec executable
run: |
cl objs\std_spec.o /Festd_spec libs\pcre.lib libs\gc.lib advapi32.lib libcmt.lib legacy_stdio_definitions.lib
- name: Run stdlib specs
run: |
.\std_spec.exe