-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.ci.yml
More file actions
131 lines (126 loc) · 4.39 KB
/
Copy path.ci.yml
File metadata and controls
131 lines (126 loc) · 4.39 KB
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
stages:
- code-quality-checks
- tests
- build-docs
check-code-quality:
stage: code-quality-checks
image: debian:bookworm
before_get_sources:
- apt -y update
- apt -y install python3 pipx git
script:
- PATH="/root/.local/bin:$PATH"
- pipx install yapf==0.40.2
- yapf -ipr protoplaster/ manager/
- test $(git status --porcelain | wc -l) -eq 0 || { git diff; false; }
installation-test:
stage: tests
image: debian:bookworm
before_get_sources:
- apt -y update
- apt -y install python3 python3-venv python3-dev build-essential git
script:
- PATH="/root/.local/bin:$PATH"
- python3 -m venv ./venv
- source ./venv/bin/activate
- pip install .
- cd /tmp/
- protoplaster --help
build-docs:
stage: build-docs
image: btdi/latex
before_get_sources:
- apt -y update
- apt -y install python3 python3-venv git make
script:
- PATH="/root/.local/bin:$PATH"
- python3 -m venv ./venv
- source ./venv/bin/activate
- pip install .
- pip install git+https://github.com/antmicro/tuttest
- tuttest README.md example > example.yml
- protoplaster --test-dir . --reports-dir . --artifacts-dir . -t example.yml --generate-docs
- protoplaster --test-dir . --reports-dir . --artifacts-dir . --generate-docs
- protoplaster --test-dir . --reports-dir . --artifacts-dir . --test-file example.yml --csv report.csv
# Merge all generated report_*.csv files into report.csv, keep only the first header
- awk 'FNR==1 && NR!=1{next;}{print}' report_*.csv > report.csv
- protoplaster-test-report report.csv -t md
- cp -r .github/docs-template docs/
- cp README.md docs/source/readme.md
- cp tests_description.md docs/source/
- cp tests_reference.md docs/source/
- cp report.md docs/source/
- tuttest README.md system-report-example > system-report-example.yml
- protoplaster-system-report -c system-report-example.yml
- echo -e "\`\`\`\n$(cat system-report-example.yml)\n\`\`\`" >> docs/source/system-report-example.yml
- mkdir -p docs/source/_static/system_report
- unzip report.zip -d docs/source/_static/system_report
- ./.github/scripts/sphinx.sh
- ./.github/scripts/latex.sh
artifacts:
paths:
- docs/build/html/*
api-test:
stage: tests
image: debian:bookworm
before_get_sources:
- apt -y update
- apt -y install python3 python3-venv python3-dev build-essential git curl jq
script:
- PATH="/root/.local/bin:$PATH"
- python3 -m venv ./venv
- source ./venv/bin/activate
- pip install .
- |
for f in tests/*.sh; do
bash "$f"
done
artifacts:
paths:
- srv/protoplaster/*
when: always
renode-test:
stage: tests
only:
refs:
- main
- merge_requests
image: debian:trixie
variables:
BGS_ACTION_REPO: antmicro/renode-linux-runner-action
BGS_ACTION_REF: renode_portable_build_essential
BGS_RENODE_VERSION: "1.16.1"
DEVICES: |
vivid
gpio 0 32
i2c 0x1C
CMD: |
python -m venv venv-protoplaster
source venv-protoplaster/bin/activate
pip install . --progress-bar=off
protoplaster -d tests -r . -a . -t basic.yml
protoplaster -d tests -r . -a . -t backward.yml
before_get_sources:
- apt-get -y update
- DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends git wget python3-venv screen libicu76 telnet e2fsprogs iproute2 iptables procps sudo jq python-is-python3
- git clone https://github.com/$BGS_ACTION_REPO /renode_action
- git -C /renode_action switch --detach refs/tags/$BGS_ACTION_REF
- wget -q --no-verbose https://github.com/renode/renode/releases/download/v${BGS_RENODE_VERSION}/renode-${BGS_RENODE_VERSION}.linux-portable-dotnet.tar.gz -O /renode.tar.gz
- mkdir /opt/renode
- tar xzf /renode.tar.gz --strip-components=1 -C /opt/renode
- rm /renode.tar.gz
script:
- PATH=$PATH:/opt/renode
- cd /renode_action
- python3 -m venv .venv
- source .venv/bin/activate
- PS1='# ' # the script expects # to be the prompt character
- sysctl -w net.ipv4.ip_forward=1 # enable routing inside Renode
- pip3 install -r requirements.txt
- RUN_CONF=$(jq -n
--arg arch riscv64
--arg devices "$DEVICES"
--arg renode-run "$CMD"
--arg shared-dirs ./
'$ARGS.named')
- python3 action/run-in-renode.py "$RUN_CONF" "/ci" "$BGS_ACTION_REPO" "$BGS_ACTION_REF"