-
Notifications
You must be signed in to change notification settings - Fork 135
171 lines (148 loc) · 4.5 KB
/
test-projects.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
name: Test projects
on:
push:
paths-ignore:
- 'docs/**'
- 'README.md'
- '**/README.md'
- 'LICENSE'
- 'CONTRIBUTING.md'
- 'CODE_OF_CONDUCT.md'
- 'AUTHORS'
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- '**/README.md'
- 'LICENSE'
- 'CONTRIBUTING.md'
- 'CODE_OF_CONDUCT.md'
- 'AUTHORS'
workflow_dispatch:
paths-ignore:
- 'docs/**'
- 'README.md'
- '**/README.md'
- 'LICENSE'
- 'CONTRIBUTING.md'
- 'CODE_OF_CONDUCT.md'
- 'AUTHORS'
jobs:
setup-matrix:
runs-on: ubuntu-20.04
outputs:
matrix-combinations: ${{ steps.setup-matrix-combinations.outputs.matrix-combinations }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.7'
- name: Setup matrix combinations
id: setup-matrix-combinations
run: |
export MATRIX_PARAMS=$(./.github/scripts/generate_ci_matrix.py)
echo "::set-output name=matrix-combinations::{\"include\":$MATRIX_PARAMS}"
- name: Setup environment
run: |
echo "RENODE_VERSION=$(cat conf/renode.version)" >> $GITHUB_ENV
echo "RENODE_DIR=third_party/renode" >> $GITHUB_ENV
- name: Download Renode
uses: antmicro/[email protected]
with:
renode-version: '${{ env.RENODE_VERSION }}'
renode-path: '${{ env.RENODE_DIR }}'
- name: Cache Renode installation
uses: actions/cache@v3
id: cache-renode
with:
path: '${{ env.RENODE_DIR }}'
key: cfu-cache-renode-${{ env.RENODE_VERSION }}
- name: Cache Conda packages
uses: actions/cache@v3
id: cache-conda
with:
path: ~/conda_pkgs_dir
key: cfu-cache-conda-${{ github.sha }}
- name: Build Conda Env
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: '3.7'
environment-file: .github/misc/test-environment.yml
activate-environment: "test"
- name: check conda env
run: |
conda info
conda list
yosys --version
test-projects:
runs-on: ubuntu-20.04
continue-on-error: True
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix-combinations) }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.7'
- name: Prepare Renode version
run: |
echo "RENODE_VERSION=$(cat conf/renode.version)" >> $GITHUB_ENV
echo "RENODE_DIR=third_party/renode" >> $GITHUB_ENV
- name: Restore Renode
uses: actions/cache@v3
id: cache-renode
with:
path: '${{ env.RENODE_DIR }}'
key: cfu-cache-renode-${{ env.RENODE_VERSION }}
- name: Restore cached Conda packages
uses: actions/cache@v3
id: cache-conda
with:
path: ~/conda_pkgs_dir
key: cfu-cache-conda-${{ github.sha }}
- name: Build Conda Env
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: '3.7'
environment-file: .github/misc/test-environment.yml
activate-environment: "test"
- name: Setup environment
run: |
bash scripts/setup -ci
- name: Build sample & generate Renode scripts
run:
pwd && source environment && cd proj/${{ matrix.proj_name }} &&
make ${{ matrix.build_params }} PLATFORM=${{ matrix.platform }} TARGET=${{ matrix.target }} -j8 software &&
make renode-scripts ${{ matrix.build_params }} PLATFORM=${{ matrix.platform }} TARGET=${{ matrix.target }}
- name: Run tests
timeout-minutes: 15
uses: antmicro/[email protected]
with:
renode-version: '${{ env.RENODE_VERSION }}'
tests-to-run: proj/${{ matrix.proj_name }}/build/renode/${{ matrix.target }}.robot
renode-path: '${{ env.RENODE_DIR }}'
- name: Archive results
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.proj_name }}-${{ matrix.platform }}-${{ matrix.target }}
path: |
report.html
log.html
robot_output.xml
snapshots