-
Notifications
You must be signed in to change notification settings - Fork 3
130 lines (108 loc) · 3.76 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
on:
[push]
name: Build and Lint
permissions:
contents: write
env:
RUSTFLAGS: -Dwarnings
# VCPKG_ROOT: ${{ github.workspace }}/vcpkg
# LIBCLANG_PATH: ${{ runner.temp }}/llvm/lib
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
- name: Set up cache
uses: actions/cache/restore@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Clippy Lints
run: |
cargo clippy --all-targets --all-features
# - id: mirai_check
# run: |
# echo "mirai=$(cargo mirai --help && echo 1 || echo 0)" >> $GITHUB_OUTPUT
#- name: Install LLVM and Clang
# uses: KyleMayes/install-llvm-action@v2
#with:
# version: "10.0"
# directory: ${{ runner.temp }}/llvm
#- run: |
# echo "LIBCLANG_PATH=$( ${{ runner.temp }}/llvm/bin )" >> $GITHUB_ENV
#- if: steps.mirai_check.outputs.mirai == 0
# working-directory: ${{ runner.temp }}
#run: |
#sudo ln -s ${{ env.LLVM_PATH }}/lib/libclang-11.so.1 /lib/x86_64-linux-gnu/libclang.so
# git clone https://github.com/facebookexperimental/MIRAI.git
#git clone --depth=1 https://github.com/llvm/llvm-project.git
#sudo apt update
# sudo apt install -y cmake build-essential libtool autoconf libncurses-dev
#cd llvm-project
#mkdir build
#cd build
#cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm
#make
#echo "${{ runner.temp }}/llvm/build/bin" >> $GITHUB_PATH
#echo "LIBCLANG_PATH=${{ runner.temp }}/llvm/build/lib" >> $GITHUB_ENV
#- name: Install Z3
# if: steps.mirai_check.outputs.mirai == 0
#uses: johnwason/vcpkg-action@v5
#with:
# pkgs: z3
# triplet: x64-linux
# cache-key: ${{ runner.os }}
# revision: master
# token: ${{ secrets.PAT }}
# extra-args: --clean-buildtrees-after-build
#- name: Install mirai
# working-directory: ${{ runner.temp }}
# if: steps.mirai_check.outputs.mirai == 0
#run: |
# echo $LIBCLANG_PATH
# ls -la $LIBCLANG_PATH
# cd MIRAI
# cargo install --locked --force --path ./checker --no-default-features --features=vcpkg
#- name: Run mirai
# run: |
# cargo mirai --diag=default
- name: Build
run: |
cargo build --release
- name: Format
run: |
cargo +nightly fmt
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
if [ "`git status --porcelain`" ]; then git commit -am "refactor: rustfmt [skip ci]" && git push; fi
- name: Set up cache
uses: actions/cache/restore@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
path: ./target/release/alerion*