-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (109 loc) · 4.38 KB
/
Windows-LLVM.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
name: Windows-LLVM
on:
pull_request:
branches: [main, develop]
paths-ignore:
- '.github/workflows/Windows-MSVC.yml'
- '.github/workflows/Linux.yml'
- '.github/workflows/macOS.yml'
- '.github/workflows/iOS.yml'
- '.github/workflows/Android.yml'
- '.github/workflows/AutoMerger.yml'
- '.gitignore'
- 'LICENSE'
- 'README.md'
push:
branches: [develop]
paths-ignore:
- '.github/workflows/Windows-MSVC.yml'
- '.github/workflows/Linux.yml'
- '.github/workflows/macOS.yml'
- '.github/workflows/iOS.yml'
- '.github/workflows/Android.yml'
- '.github/workflows/AutoMerger.yml'
- '.gitignore'
- 'LICENSE'
- 'README.md'
jobs:
build:
name: ${{ matrix.os }}-LLVM-${{ matrix.arch }} ( ${{ matrix.kind }}-${{ matrix.mode }} )
strategy:
fail-fast: false
matrix:
os: [windows-2022]
kind: [static, shared]
mode: [release, debug, asan]
arch: [x64]
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.os }}-LLVM-${{ matrix.kind }}-${{ matrix.mode }}
steps:
- name: Configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.3
with:
minimum-size: 8GB
maximum-size: 32GB
disk-root: "D:"
- name: Get current date as package key
id: cache_key
run: echo "key=$(date +'%W')" >> $env:GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache LLVM
id: cache_llvm
uses: actions/cache@v4
with:
path: ${{ runner.workspace }}/StormKit/llvm/
key: ${{ matrix.os }}-llvm
save-always: true
restore-keys: |
${{ matrix.os }}-llvm
- name: Download and Uncompress LLVM
if: ${{ steps.cache_llvm.outputs.cache-hit != 'true' }}
run: |
C:/msys64/usr/bin/wget 'https://github.com/Arthapz/llvm-prebuilt/raw/main/Windows/llvm.7z.001'
C:/msys64/usr/bin/wget 'https://github.com/Arthapz/llvm-prebuilt/raw/main/Windows/llvm.7z.002'
7z x llvm.7z.001
rm llvm.7z.001
rm llvm.7z.002
- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: "branch@dev"
actions-cache-folder: .xmake-cache-${{ steps.cache_key.outputs.key }}
- name: Update xmake to patched xmake
run: xmake update -s --integrate github:Arthapz/xmake#modules
- name: Update xmake repository
run: xmake repo --update -v
- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Retrieve cached xmake dependencies
uses: actions/cache@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ matrix.os }}-LLVM-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-${{ steps.cache_key.outputs.key }}
- name: Configure & Build
id: build_llvm
run: |
xmake f -v --yes -a ${{ matrix.arch }} -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --examples=y --tests=y --toolchain=llvm --sdk="${{ runner.workspace }}/StormKit/llvm/" --runtimes="c++_shared"
xmake b -v
- name: Tests
run: |
cp "${{ runner.workspace }}/StormKit/llvm/lib/c++.dll" "${{ runner.workspace }}/StormKit/build/windows/${{ matrix.arch }}/${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }}/"
xmake test -v
- name: Installation
run: |
xmake install -v --installdir="${{ runner.workspace }}/output"
cp "${{ runner.workspace }}/StormKit/llvm/lib/c++.dll" "${{ runner.workspace }}/output/bin/"
rmdir /s /q "StormKit"
- name: Upload artifacts
id: upload
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-LLVM-${{ matrix.kind }}-${{ matrix.mode }}
path: ${{ runner.workspace }}/output