-
Notifications
You must be signed in to change notification settings - Fork 11
167 lines (161 loc) · 6.2 KB
/
ci.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: CI
on:
push:
branches: [main]
pull_request:
merge_group:
types: [checks_requested]
jobs:
check:
name: clippy
runs-on: ubuntu-latest
env:
MLIR_SYS_170_PREFIX: /usr/lib/llvm-17/
LLVM_SYS_170_PREFIX: /usr/lib/llvm-17/
TABLEGEN_170_PREFIX: /usr/lib/llvm-17/
steps:
- uses: actions/checkout@v3
- uses: dtolnay/[email protected]
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@10
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools
- name: Clippy
run: make check
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/[email protected]
with:
components: rustfmt
- run: cargo fmt --all -- --check
test:
name: test (linux, amd64)
runs-on: ubuntu-latest
env:
MLIR_SYS_170_PREFIX: /usr/lib/llvm-17/
LLVM_SYS_170_PREFIX: /usr/lib/llvm-17/
TABLEGEN_170_PREFIX: /usr/lib/llvm-17/
RUST_LOG: debug
steps:
- uses: actions/checkout@v3
- name: free HDD space
run: |
# deleting space
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/lib/android
- name: Setup rust env
uses: dtolnay/[email protected]
- name: Retreive cached dependecies
uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@10
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools
- name: Install Link deps
run: sudo apt-get install libc-dev build-essential
- name: test
run: make test
coverage:
name: coverage
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
MLIR_SYS_170_PREFIX: /usr/lib/llvm-17/
LLVM_SYS_170_PREFIX: /usr/lib/llvm-17/
TABLEGEN_170_PREFIX: /usr/lib/llvm-17/
RUST_LOG: debug
steps:
- uses: actions/checkout@v3
- name: free HDD space
run: |
# deleting space
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/lib/android
- name: Setup rust env
uses: dtolnay/[email protected]
- name: Retreive cached dependecies
uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@10
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools
- name: Install Link deps
run: sudo apt-get install libc-dev build-essential
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: test and generate coverage
run: make coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
bench:
name: Bench
runs-on: ubuntu-latest
env:
MLIR_SYS_170_PREFIX: /usr/lib/llvm-17/
LLVM_SYS_170_PREFIX: /usr/lib/llvm-17/
TABLEGEN_170_PREFIX: /usr/lib/llvm-17/
steps:
- uses: actions/checkout@v4
- name: free HDD space
run: |
# deleting space
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/lib/android
- uses: dtolnay/[email protected]
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Setup rust env
uses: dtolnay/[email protected]
- name: Retreive cached dependecies
uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@10
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools
- name: Install Link deps
run: sudo apt-get install libc-dev build-essential
- name: Run bench
run: ./bench/bench.sh | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' > bench.md
- name: Find Bench Comment
continue-on-error: true
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Benchmarking
- name: Create or update bench comment
continue-on-error: true
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-path: bench.md
edit-mode: replace