forked from firesim/FireMarshal
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (139 loc) · 4.73 KB
/
run-tests.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
name: run-tests
on:
# run ci when the following branches are pushed to (i.e. after merge)
push:
branches:
- master
# run ci when pring to following branches (note: ci runs on the merge commit of the pr!)
pull_request:
branches:
- master
defaults:
run:
shell: bash -leo pipefail {0}
env:
REMOTE_WORK_DIR: /scratch/buildbot/firemarshal-ci-shared/firemarshal-${{ github.sha }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.BARTENDER_PERSONAL_ACCESS_TOKEN }}
jobs:
cancel-prior-workflows:
name: cancel-prior-workflows
runs-on: ubuntu-20.04
steps:
- name: Cancel previous workflow runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
# Set up a set of boolean conditions to control which branches of the CI
# workflow will execute This is based off the conditional job execution
# example here: https://github.com/dorny/paths-filter#examples
change-filters:
name: filter-jobs-on-changes
runs-on: ubuntu-20.04
# Queried by downstream jobs to determine if they should run.
outputs:
run-core: ${{ steps.filter.outputs.all_count != steps.filter.outputs.non-core-files_count }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
all:
- '**'
# Check for if docs files changed
docs: &docs-filter
- 'docs/**'
- '.readthedocs.yml'
# Check for non-FireMarshal core file changes
non-core-files:
- *docs-filter
- '**/*.md'
- '**/.gitignore'
setup-repo:
name: setup-repo
needs: change-filters
if: needs.change-filters.outputs.run-core == 'true'
runs-on: firemarshal
steps:
- name: Delete old checkout
run: |
ls -alh .
rm -rf ${{ env.REMOTE_WORK_DIR }}/* || true
rm -rf ${{ env.REMOTE_WORK_DIR }}/.* || true
rm -rf ${{ github.workspace }}/* || true
rm -rf ${{ github.workspace }}/.* || true
- uses: actions/checkout@v4
- name: Setup repo copy
run: |
git clone $GITHUB_WORKSPACE ${{ env.REMOTE_WORK_DIR }}
- name: Setup conda (install all deps)
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
./scripts/setup-conda.sh
- name: Install Spike
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
conda activate $PWD/.conda-env
git clone https://github.com/riscv-software-src/riscv-isa-sim.git
cd riscv-isa-sim
git checkout 4d8651b
mkdir build
cd build
../configure --prefix=$RISCV --with-boost=no --with-boost-asio=no --with-boost-regex=no
make -j16
make install
- name: Initialize all submodules
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
conda activate $PWD/.conda-env
./init-submodules.sh
- name: Verify open file limits
run: |
HARD_LIMIT=$(ulimit -Hn)
REQUIRED_LIMIT=16384
if [ "$HARD_LIMIT" -lt "$REQUIRED_LIMIT" ]; then
echo "ERROR: Your system does not support an open files limit (the output of 'ulimit -Sn' and 'ulimit -Hn') of at least $REQUIRED_LIMIT, which is required to workaround a bug in buildroot. You will not be able to build a Linux distro with FireMarshal until this is addressed."
exit 1
fi
ulimit -Sn $(ulimit -Hn)
build-upload-br-image:
name: build-upload-br-image
needs: [setup-repo]
if: ${{ github.ref == 'master' }}
runs-on: firemarshal
steps:
- name: Build buildroot image
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
conda activate $PWD/.conda-env
./marshal -v build br-base.json
./scripts/upload-br-image.py
run-tests:
name: run-tests
needs: [setup-repo]
runs-on: firemarshal
steps:
- name: Run tests (- spike tests)
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
conda activate $PWD/.conda-env
./scripts/fullTest.py -c baremetal qemu smoke special -s
- name: Dump log
if: ${{ always() }}
run: |
cd ${{ env.REMOTE_WORK_DIR }}
cat ./scripts/testLogs/*.log
cleanup:
name: cleanup
needs: [setup-repo, build-upload-br-image, run-tests]
runs-on: firemarshal
if: ${{ always() }}
steps:
- name: Delete repo copy and conda env
run: |
rm -rf ${{ env.REMOTE_WORK_DIR }}