-
Notifications
You must be signed in to change notification settings - Fork 119
55 lines (44 loc) · 1.78 KB
/
windows_test.yaml
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
name: build-and-test-windows
on: ["push", "pull_request"]
jobs:
build-and-test:
name: build and test on windows
runs-on: windows-latest
env:
LLVM_SYS_120_PREFIX: "C:/LLVM"
KCLVM_CLANG: "C:/LLVM/bin/clang.exe"
steps:
- name: Git checkout
uses: actions/checkout@v2
with:
submodules: "true"
- name: Set up Go 1.18
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Install kpm
run: go install kcl-lang.io/kpm@latest
- uses: ilammy/msvc-dev-cmd@v1
- run: clang --version
- run: cargo --version
# Install LLVM-12
- run: Invoke-WebRequest -Uri https://github.com/kcl-lang/llvm-package-windows/releases/download/v12.0.1/LLVM-12.0.1-win64.7z -OutFile C:/LLVM-12.0.1-win64.7z
- run: Get-FileHash -Algorithm MD5 C:/LLVM-12.0.1-win64.7z # md5: 3fcf77f82c6c3ee650711439b20aebe5
- run: 7z x -y C:/LLVM-12.0.1-win64.7z -o"C:/LLVM"
- run: Remove-Item C:/LLVM-12.0.1-win64.7z
- run: echo "C:/LLVM/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# Build kclvm-cli
- run: .\scripts\build-windows\build.bat
# Set kclvm-cli path
- run: echo ";$(pwd)\scripts\build-windows\_output\kclvm-windows\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
working-directory: .
# Rust unit test
- run: cargo test -p kclvm-*
working-directory: ./kclvm
# Rust runtime test
- run: python3 -m pip install --upgrade pip && python3 -m pip install pytest && kclvm -m pytest -vv
working-directory: ./kclvm/tests/test_units
- uses: actions/upload-artifact@v3
with:
name: kcl-windows
path: scripts/build-windows/_output/kclvm-windows