-
Notifications
You must be signed in to change notification settings - Fork 118
67 lines (64 loc) · 2 KB
/
ubuntu_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
56
57
58
59
60
61
62
63
64
65
66
name: build-and-test-ubuntu
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build-and-test:
# Ref: https://github.com/actions/runner-images/tree/main/images/linux
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: "true"
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.23
# Prerequisite
- name: Install Python3 (for Grammar test)
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y git wget curl make
sudo apt-get install python3 python3-pip -y
- name: Install rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.79
override: true
components: clippy, rustfmt
- name: Code format check
working-directory: ./kclvm
run: cargo fmt --check
shell: bash
- name: Code clippy check
working-directory: ./kclvm
run: cargo clippy --no-deps -r
shell: bash
- name: Grammar test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/linux/kclvm/bin && make && make test-grammar
shell: bash
- name: Evaluator Grammar test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/linux/kclvm/bin && make test-grammar-evaluator
shell: bash
- name: Runtime test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/linux/kclvm/bin && make test-runtime
shell: bash
- name: Install KCL CLI
run: |
go install kcl-lang.io/cli/cmd/kcl@main
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
echo "${{ github.workspace }}/go/bin" >> $GITHUB_PATH
- name: Unit test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/linux/kclvm/bin && make test
shell: bash