-
Notifications
You must be signed in to change notification settings - Fork 4
106 lines (93 loc) · 3.18 KB
/
cache-clang.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
name: Cache clang Toolchain
defaults:
run:
shell: D:\msys64\msys2.cmd {0}
on:
workflow_dispatch:
inputs:
toolchain:
description: "toolchain"
required: false
default: "mingw64-clang"
type: choice
options:
- mingw64-clang
- llvm-mingw
#schedule:
#- cron: '05 0 * * MON'
jobs:
build:
runs-on: windows-2022
steps:
- name: Cache msys2
uses: actions/cache@main
id: msys2
with:
path: D:\msys64
key: msys2
- name: Cache Toolchain
uses: actions/cache@main
id: clang-ucrt
with:
path: D:\ucrt64
key: clang-ucrt-x86_64
- name: Install msys2
if: (steps.msys2.outputs.cache-hit != 'true' && inputs.toolchain == 'llvm-mingw')
uses: msys2/setup-msys2@v2
with:
cache: false
location: D:\
install: base-devel autotools git p7zip
- name: Install MinGW-w64-clang Toolchain
if: (steps.clang-ucrt.outputs.cache-hit != 'true' && inputs.toolchain == 'mingw64-clang')
uses: msys2/setup-msys2@v2
with:
cache: false
location: D:\
install: >-
base-devel
autotools
git
yasm
nasm
p7zip
mingw-w64-clang-x86_64-gettext-tools
mingw-w64-clang-x86_64-gettext-runtime
mingw-w64-clang-x86_64-pkgconf
mingw-w64-clang-x86_64-clang
mingw-w64-clang-x86_64-libc++
mingw-w64-clang-x86_64-gcc-compat
mingw-w64-clang-x86_64-tools-git
mingw-w64-clang-x86_64-meson
mingw-w64-clang-x86_64-cmake
mingw-w64-clang-x86_64-make
- name: Prepare
run: git config --global core.autocrlf input
shell: bash
- name: Checkout
uses: actions/checkout@main
- name: Config msys2
if: steps.msys2.outputs.cache-hit != 'true'
shell: bash
run: |
cp msys2-config/msys2.cmd /d/msys64
install -m644 msys2-config/*.conf /d/msys64/etc/
install -m755 msys2-config/makepkg-* /d/msys64/usr/bin/
- name: Install llvm-mingw Toolchain
if: (steps.clang-ucrt.outputs.cache-hit != 'true' && inputs.toolchain == 'llvm-mingw')
run: |
curl -OL https://github.com/eko5624/toolchain/releases/download/toolchain/target-llvm-mingw-latest-ucrt-x86_64.7z
7z x target-llvm-mingw*.7z -o/d && mv /d/target /d/ucrt64
- name: Install curl
if: (steps.clang-ucrt.outputs.cache-hit != 'true' && inputs.toolchain == 'mingw64-clang')
run: |
mv /d/msys64/clang64 /d/ucrt64
curl -L -o curl-win64-mingw.zip 'https://curl.se/windows/latest.cgi?p=win64-mingw.zip'
7z x curl*.zip
cp curl*/bin/curl-ca-bundle.crt /d/ucrt64/bin
cp curl*/bin/curl.exe /d/ucrt64/bin
- name: Remove "libwinpthread.dll.a libpthread.dll.a libc++.dll.a" from MinGW-w64-CLANG Toolchain
if: (steps.clang-ucrt.outputs.cache-hit != 'true' && inputs.toolchain == 'mingw64-clang')
run: |
find /d/ucrt64/lib -type f \( -name "*pthread.dll.a" \) -print0 | xargs -0 -I {} rm {}
find /d/ucrt64/lib -type f \( -name "libc++.dll.a" \) -print0 | xargs -0 -I {} rm {}