forked from lowRISC/cheriot-rtos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
149 lines (145 loc) · 5.41 KB
/
azure-pipelines.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
trigger:
- core
resources:
pipelines:
- pipeline: LLVM
project: CHERI-MCU
source: LLVM
- pipeline: Flute-TCM
project: CHERI-MCU
source: Flute-TCM
- pipeline: sail-cheri-mcu
project: CHERI-MCU
source: sail-cheri-mcu
jobs:
############################################## Linux Builds
- job:
displayName: RTOS tests
pool:
vmImage: ubuntu-20.04
timeoutInMinutes: 300
strategy:
matrix:
HardwareRevokerRelease:
board: flute
flags: --debug-loader=n --debug-scheduler=n --debug-allocator=n
mode: release
SoftwareRevokerRelease:
board: flute-software-revoker
flags: --debug-loader=n --debug-scheduler=n --debug-allocator=n
mode: release
SailRelease:
board: sail
flags: --debug-loader=n --debug-scheduler=n --debug-allocator=n
mode: release
HardwareRevokerDebug:
board: flute
flags: --debug-loader=y --debug-scheduler=y --debug-allocator=y
mode: debug
SoftwareRevokerDebug:
board: flute-software-revoker
flags: --debug-loader=y --debug-scheduler=y --debug-allocator=y
mode: debug
SailDebug:
board: sail
flags: --debug-loader=y --debug-scheduler=y --debug-allocator=y
mode: debug
steps:
- checkout: self
submodules: recursive
- download: LLVM
- download: Flute-TCM
- download: sail-cheri-mcu
- script: |
set -eo pipefail
sudo add-apt-repository ppa:xmake-io/xmake
sudo apt update
sudo apt install xmake
displayName: 'Installing dependencies'
- script: |
chmod +x $(Pipeline.Workspace)/$(resources.triggeringAlias)/LLVM/LLVM/bin/* \
$(Pipeline.Workspace)/$(resources.triggeringAlias)/Flute-TCM/FluteSimulator/* \
$(Pipeline.Workspace)/$(resources.triggeringAlias)/sail-cheri-mcu/SailSimulator/*
echo $(Pipeline.Workspace)/$(resources.triggeringAlias)/LLVM
echo $(Pipeline.Workspace)
ls -R $(Pipeline.Workspace)
displayName: 'See where anything is installed'
- script: |
ls $(Pipeline.Workspace)/$(resources.triggeringAlias)/LLVM/LLVM/bin/
echo xmake f -P . --board=$(board) --sdk=$(Pipeline.Workspace)/$(resources.triggeringAlias)/LLVM/LLVM/ $(flags) -m $(mode)
xmake f -P . --board=$(board) --sdk=$(Pipeline.Workspace)/$(resources.triggeringAlias)/LLVM/LLVM/ $(flags) -m $(mode)
workingDirectory: 'tests'
displayName: 'Configure the build'
- script: |
xmake -P . -v
workingDirectory: 'tests'
displayName: 'Building the test suite'
- script: |
$(Pipeline.Workspace)/$(resources.triggeringAlias)/sail-cheri-mcu/SailSimulator/cheriot_sim -p --no-trace build/cheriot/cheriot/$(mode)/test-suite
condition: startsWith(variables['board'],'sail')
workingDirectory: 'tests'
displayName: 'Running the test suite on Sail'
- script: |
export PATH=$(Pipeline.Workspace)/$(resources.triggeringAlias)/Flute-TCM/FluteSimulator:$PATH
for I in `seq 32768` ; do echo 00000000 >> tail.hex ; done
elf_to_hex build/cheriot/cheriot/$(mode)/test-suite Mem.hex
hex_to_tcm_hex.sh
cp tail.hex Mem-TCM-tags-0.hex
exe_HW_sim +tohost | tee sim.log
EXIT_CODE=$(expr $(printf '%d' $(grep -E -e 'tohost_value is 0x[0-9a-zA-Z]+' -o sim.log | awk '{print $3}')) / 2)
echo "Exit code: $EXIT_CODE"
exit $EXIT_CODE
condition: startsWith(variables['board'],'flute')
workingDirectory: 'tests'
displayName: 'Running the test suite on Flute'
- script: |
set -eo pipefail
for example_dir in $PWD/examples/*/; do
cd $example_dir
echo Building $example_dir
xmake f --board=$(board) --sdk=$(Pipeline.Workspace)/$(resources.triggeringAlias)/LLVM/LLVM/ $(flags) -m $(mode)
xmake
done
displayName: 'Building the examples'
- script: |
set -eo pipefail
for example_dir in $PWD/examples/*/; do
cd $example_dir
echo Running $example_dir
example_name=$(basename ${example_dir#*.})
$(Pipeline.Workspace)/$(resources.triggeringAlias)/sail-cheri-mcu/SailSimulator/cheriot_sim \
build/cheriot/cheriot/$(mode)/${example_name}
done
condition: startsWith(variables['board'],'sail')
displayName: 'Running the examples'
- job:
displayName: Check coding style
pool:
vmImage: ubuntu-20.04
timeoutInMinutes: 300
steps:
- checkout: self
submodules: recursive
- download: LLVM
- script: |
chmod +x $(Pipeline.Workspace)/$(resources.triggeringAlias)/LLVM/LLVM/bin/*
echo $(Pipeline.Workspace)/$(resources.triggeringAlias)/LLVM
echo $(Pipeline.Workspace)
ls -R $(Pipeline.Workspace)
displayName: 'See where anything is installed'
- script: |
./scripts/run_clang_tidy_format.sh $(Pipeline.Workspace)/$(resources.triggeringAlias)/LLVM/LLVM/bin/
displayName: 'Running clang-tidy and clang-format'
- job:
displayName: Compliance checks
pool:
vmImage: windows-latest
steps:
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
displayName: 'Run CredScan'
inputs:
debugMode: false
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'
- task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@3
displayName: 'Publish Security Analysis Logs'