-
-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (49 loc) · 1.46 KB
/
rust.yml
File metadata and controls
59 lines (49 loc) · 1.46 KB
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
name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install LLVM 14
run: |
sudo apt-get update
sudo apt-get install llvm-14 llvm-14-dev clang-14 libclang-14-dev lld-14
sudo ln -s /usr/lib/llvm-14/lib/libLLVM-14.so /usr/lib/libllvm-14.so
- name: Set LLVM environment variables
run: |
export LLVM_SYS_140_PREFIX=/usr/lib/llvm-14
- name: Build
run: |
source ~/.bashrc
cargo clean
cargo build --verbose
- name: Run tests
run: cargo test --verbose
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install LLVM 14
run: |
brew update
brew install llvm@14
- name: Set LLVM environment variables
run: |
if [ -d "/usr/local/opt/llvm@14" ]; then
echo "LLVM_SYS_140_PREFIX=/usr/local/opt/llvm@14" >> $GITHUB_ENV
echo "PATH=/usr/local/opt/llvm@14/bin:$PATH" >> $GITHUB_ENV
else
echo "LLVM_SYS_140_PREFIX=/opt/homebrew/opt/llvm@14" >> $GITHUB_ENV
echo "PATH=/opt/homebrew/opt/llvm@14/bin:$PATH" >> $GITHUB_ENV
fi
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose