-
Notifications
You must be signed in to change notification settings - Fork 3
179 lines (159 loc) · 5.81 KB
/
validate.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Validate
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CI: 1
CARGO_TERM_COLOR: always
RENODE_DIR: /opt/renode/
# Used by renode-test to generate snapshots of failed tests
RENODE_CI_MODE: YES
DLA_BIN: dla
DLA_VALIDATION_BIN: validate
jobs:
check-bsp:
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- name: Install requirements
run: rustup target add riscv64imac-unknown-none-elf riscv32im-unknown-none-elf
- name: Run linter
working-directory: ./examples/headsail-bsp
run: cargo clippy -- -D clippy::style
- name: Check BSP (-Fsysctrl-rt)
working-directory: ./examples/headsail-bsp
run: cargo check -Fsysctrl-rt
- name: Check BSP (-Fsysctrl-rt -Fvp)
working-directory: ./examples/headsail-bsp
run: cargo check -Fsysctrl-rt -Fvp
- name: Check BSP examples (-Fsysctrl-rt)
working-directory: ./examples/headsail-bsp
run: cargo check --examples -Fsysctrl-rt -Fpanic-apb-uart0
- name: Check BSP examples (-Fsysctrl-rt -Fvp)
working-directory: ./examples/headsail-bsp
run: cargo check --examples -Fsysctrl-rt -Fvp -Fpanic-apb-uart0
- name: Check BSP (-Fhpc-rt)
working-directory: ./examples/headsail-bsp
run: cargo check -Fhpc-rt
- name: Check BSP (-Fhpc-rt -Fvp)
working-directory: ./examples/headsail-bsp
run: cargo check -Fhpc-rt -Fvp
- name: Check BSP examples (-Fhpc-rt)
working-directory: ./examples/headsail-bsp
run: cargo check --examples -Fhpc-rt -Fpanic-apb-uart0
- name: Check BSP examples (-Fhpc-rt -Fvp)
working-directory: ./examples/headsail-bsp
run: cargo check --examples -Fhpc-rt -Fvp -Fpanic-apb-uart0
build-dla-example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install requirements
run: rustup target add riscv64imac-unknown-none-elf
- name: Run linter
working-directory: ./examples/hpc/
run: cargo clippy -- -D clippy::style
- name: Build examples
working-directory: ./examples/hpc/hello-dla
run: cargo build --example dla
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: $DLA_BIN
path: ./examples/hpc/target/riscv64imac-unknown-none-elf/debug/examples/dla
if-no-files-found: error
retention-days: 14
run-dla-example:
needs: build-dla-example
runs-on: ubuntu-latest
container:
image: antmicro/renode:1.14.0
options: --user root
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: $DLA_BIN
- name: Create Renode peripheral symlinks
run: ln -s $(readlink -f "./vp/devel/python_peripherals/DLA.py") "$RENODE_DIR/scripts/pydev/DLA.py"
- name: Run example
run: renode-test scripts/robot/is_hello.robot --variable BIN:"$(readlink -f $DLA_BIN)"
- name: Upload snapshots
if: failure()
uses: actions/upload-artifact@v4
with:
path: snapshots/
build-dla-validation:
runs-on: ubuntu-latest
env:
RISCV: /opt/riscv/
GCC_VER: "2024.04.12"
RISCV_XLEN: riscv64
UBUNTU_VER: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Create RISC-V GCC build directory
shell: bash
run: mkdir /tmp/riscv-gnu-toolchain
- name: Download GCC
working-directory: /tmp/riscv-gnu-toolchain/
run: |
wget -q https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/$GCC_VER/$RISCV_XLEN-elf-$UBUNTU_VER-gcc-nightly-$GCC_VER-nightly.tar.gz
mkdir ${RISCV} && \
tar -xf $RISCV_XLEN-elf-$UBUNTU_VER-gcc-nightly-$GCC_VER-nightly.tar.gz --strip-components 1 -C $RISCV
export PATH="${RISCV}"/bin:${PATH}
echo "${RISCV}/bin" >> $GITHUB_PATH
$RISCV_XLEN-unknown-elf-gcc --version
$RISCV_XLEN-unknown-elf-ld --version
- name: Install rustup target
run: rustup target add riscv64imac-unknown-none-elf
- name: Build validation
working-directory: ./examples/hpc/dla-driver
run: cargo build --example validate -Fvp -Fhpc --target riscv64imac-unknown-none-elf
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: $DLA_VALIDATION_BIN
path: ./examples/hpc/target/riscv64imac-unknown-none-elf/debug/examples/validate
if-no-files-found: error
retention-days: 14
run-dla-validation:
needs: build-dla-validation
runs-on: ubuntu-latest
container:
image: antmicro/renode:1.14.0
options: --user root
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: $DLA_VALIDATION_BIN
- name: Install python dependencies
run: pip install -r ./scripts/robot/requirements.txt
- name: Create Renode peripheral symlinks
run: ln -s $(readlink -f "./vp/devel/python_peripherals/DLA.py") "$RENODE_DIR/scripts/pydev/DLA.py"
- name: Run dla validation
run: renode-test ./scripts/robot/dla_validate.robot --variable BIN:"$(readlink -f $DLA_VALIDATION_BIN)"
- name: Upload snapshots
if: failure()
uses: actions/upload-artifact@v4
with:
path: snapshots/
build-ffi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install requirements
run: rustup target add riscv64imac-unknown-none-elf riscv32im-unknown-none-elf
- name: Build FFI without RT on SysCtrl
working-directory: ./examples/headsail-bsp-ffi
run: cargo build --target=riscv32im-unknown-none-elf -Fpanic-apb-uart0
- name: Build FFI without RT on HPC
working-directory: ./examples/headsail-bsp-ffi
run: cargo build --target=riscv64imac-unknown-none-elf -Fpanic-apb-uart0