-
Notifications
You must be signed in to change notification settings - Fork 20
102 lines (86 loc) · 2.94 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
name: Checks
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- '.github/workflows/build.yml'
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
with:
fetch_depth: 0
dir_names: true
dir_names_max_depth: 1
- 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
if:
contains(steps.changed-files.outputs.all_modified_files, 'tinkernet') || contains(steps.changed-files.outputs.all_modified_files, 'invarch')
run: sudo apt install -y git clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Build [tinkernet]
if:
contains(steps.changed-files.outputs.all_modified_files, 'tinkernet')
working-directory: ./tinkernet
run: cargo build --verbose
- name: Run tests [tinkernet]
if:
contains(steps.changed-files.outputs.all_modified_files, 'tinkernet')
working-directory: ./tinkernet
run: cargo test --verbose
- name: Run clippy [tinkernet]
if:
contains(steps.changed-files.outputs.all_modified_files, 'tinkernet')
working-directory: ./tinkernet
run: cargo clippy -- -D warnings
- name: Run cargofmt [tinkernet]
if:
contains(steps.changed-files.outputs.all_modified_files, 'tinkernet')
working-directory: ./tinkernet
run: cargo +stable fmt --all -- --check
- name: Cleanup [tinkernet]
if:
contains(steps.changed-files.outputs.all_modified_files, 'tinkernet')
working-directory: ./tinkernet
run: cargo clean
- name: Build [invarch]
if:
contains(steps.changed-files.outputs.all_modified_files, 'invarch')
working-directory: ./invarch
run: cargo build --verbose
- name: Run tests [invarch]
if:
contains(steps.changed-files.outputs.all_modified_files, 'invarch')
working-directory: ./invarch
run: cargo test --verbose
- name: Run clippy [invarch]
if:
contains(steps.changed-files.outputs.all_modified_files, 'invarch')
working-directory: ./invarch
run: cargo clippy -- -D warnings
- name: Run cargofmt [invarch]
if:
contains(steps.changed-files.outputs.all_modified_files, 'invarch')
working-directory: ./invarch
run: cargo +stable fmt --all -- --check
- name: Cleanup [invarch]
if:
contains(steps.changed-files.outputs.all_modified_files, 'invarch')
working-directory: ./invarch
run: cargo clean