-
Notifications
You must be signed in to change notification settings - Fork 20
119 lines (91 loc) · 2.6 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
name: Checks
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
get_changed_files:
runs-on: ubuntu-latest
name: Get Changed Files
outputs:
all_modified_files: ${{ steps.changed-files.outputs.all_modified_files }}
steps:
- uses: actions/checkout@v4
- name: Changed Files
id: changed-files
uses: tj-actions/changed-files@v40
with:
fetch_depth: 0
dir_names: true
dir_names_max_depth: 1
build_tinkernet:
runs-on: ubuntu-latest
name: Build Tinkernet
needs: get_changed_files
if:
contains(needs.get_changed_files.outputs.all_modified_files, 'tinkernet')
defaults:
run:
working-directory: ./tinkernet
steps:
- uses: actions/checkout@v4
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Setup for checks
run: sudo apt install -y git clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install & display rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v2
with:
workspaces: "tinkernet"
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run cargofmt
run: cargo fmt --all -- --check
build_invarch:
runs-on: ubuntu-latest
name: Build InvArch
needs: get_changed_files
if:
contains(needs.get_changed_files.outputs.all_modified_files, 'invarch')
defaults:
run:
working-directory: ./invarch
steps:
- uses: actions/checkout@v4
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Setup for checks
run: sudo apt install -y git clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install & display rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v2
with:
workspaces: "invarch"
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run cargofmt
run: cargo fmt --all -- --check