-
Notifications
You must be signed in to change notification settings - Fork 14
79 lines (65 loc) · 1.92 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
name: ci
on:
workflow_dispatch:
push:
branches:
- '**'
paths:
- 'detectors/**'
- 'utils/**'
- 'Makefile'
- 'rustle'
- 'rust-toolchain.toml'
- '.clang-tidy'
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Add LLVM deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main
repo-name: llvm
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install tools
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy-15
- name: Lint
run: make lint
- id: check_file
uses: andstor/file-existence-action@v2
with:
files: "clang-tidy-fixes.yaml"
- name: Upload fix file when something needs to be fixed?
uses: actions/upload-artifact@v3
if: steps.check_file.outputs.files_exists == 'true'
with:
name: clang-tidy-fixes
path: clang-tidy-fixes.yaml
- name: Exit when something needs to be fixed?
if: steps.check_file.outputs.files_exists == 'true'
run: exit 1
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the docker image
run: docker build --build-arg UID=`id -u` --build-arg GID=`id -g` -t rustle .
- name: Run the Docker image for unit test
run: docker run -v `pwd`:/rustle -w /rustle rustle scripts/unit_test.sh
unit-test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install tools
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.67.0
brew install llvm@15
pip3 install -r utils/requirements.txt
brew install figlet coreutils gsed
cargo install rustfilt
- name: Run test
run: scripts/unit_test.sh