-
Notifications
You must be signed in to change notification settings - Fork 8
144 lines (126 loc) · 3.67 KB
/
build.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
name: Build Alumina
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint:
name: Lint rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install Tree-sitter
run: npm install -g tree-sitter-cli
- name: Lint Rust
timeout-minutes: 10
run: make lint-rust
tests:
name: Build and test (base only)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install Tree-sitter
run: npm install -g tree-sitter-cli
- name: Install libbacktrace
if: matrix.os == 'macos-latest'
run: |
git clone https://github.com/ianlancetaylor/libbacktrace
cd libbacktrace
./configure
make -j8
sudo make install
- name: Run all tests
timeout-minutes: 10
run: make test -j8
dist-check:
name: Build and test (full)
runs-on: ubuntu-latest
strategy:
matrix:
cache_ast: [with-ast-cache, without-ast-cache]
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install Tree-sitter (with runtime)
run: |
npm install -g tree-sitter-cli
curl -fsSL https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.23.0.tar.gz | tar -xz
cd tree-sitter-*
make
sudo make install
sudo ldconfig
- name: Build full
run: make dist-check -j8
if: ${{ matrix.cache_ast == 'without-ast-cache' }}
- name: Build full (with AST cache)
run: make dist-check -j8
if: ${{ matrix.cache_ast == 'with-ast-cache' }}
env:
CACHE_AST: 1
code-coverage:
name: Collect code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install LLVM
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt-get install -y llvm-18 llvm-18-dev clang-tools-18
- name: Install Tree-sitter (with runtime)
run: |
npm install -g tree-sitter-cli
curl -fsSL https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.23.0.tar.gz | tar -xz
cd tree-sitter-*
make
sudo make install
sudo ldconfig
- name: Install rustfilt
run: cargo install rustfilt
- name: Build dist-check with coverage
timeout-minutes: 10
run: CC=clang-18 LLVM_SUFFIX=-18 make coverage -j8
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/coverage/coverage.txt
fail_ci_if_error: true
docker:
name: Build docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker build .