forked from antmicro/renode-linux-runner-action
-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
119 lines (110 loc) · 3.53 KB
/
action.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
name: Renode Linux Runner Action
description: Run your tests in a configurable, emulated Linux environment with a custom kernel and access to virtual peripherals
author: Antmicro
branding:
color: blue
icon: cpu
inputs:
renode-run:
description: Command or a list of commands to run in Renode
required: false
default: ""
shared-dirs:
description: Paths to shared directories
required: false
default:
devices:
description: Devices to set up
required: false
default: ""
arch:
despription: Processor architecture (currently only riscv64)
required: false
default: riscv64
board:
despription: Board
required: false
default: default
resc:
despription: Renode script
required: false
default: default
repl:
despription: Renode platform description
required: false
default: default
kernel:
description: Compiled linux image kernel + initramfs
required: false
default: ""
image-type:
desctiption: Type of the root filesystem method (currently only 'native')
required: false
default: native
image:
description: Linux root filesystem
required: false
default: ""
python-packages:
description: Custom python packages that will be sideloaded to emulated Linux
required: false
default: ""
repos:
description: Custom git repos that will be added to your shared dir
required: false
default: ""
network:
description: Enable network in the emulated Linux? true/false
required: false
default: true
rootfs-size:
description: Rootfs size
required: false
default: auto
fail-fast:
description: Fail fast
required: false
default: true
tasks:
description: Add your tasks to the existing configuration
required: false
default: ""
runs:
using: composite
steps:
- id: check-required-python-version
run: |
printf -v VERSIONS '%s\n%s' "$(python3 --version | awk '{ print $2 }')" $PYTHON_VERSION
if [[ "$VERSIONS" = "$(sort -V <<< "$VERSIONS")" ]]; then
echo "Minimum Python version required is $PYTHON_VERSION"
exit 1
fi
shell: bash
env:
PYTHON_VERSION: "3.10"
- id: create-working-directory
run: |
mkdir -p ${GITHUB_ACTION_PATH}
shell: bash
- id: install-packages
run: |
cd ${GITHUB_ACTION_PATH} && \
wget -q --no-verbose https://github.com/renode/renode/releases/download/v${RENODE_VERSION}/renode_${RENODE_VERSION}_amd64.deb && \
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
./renode_${RENODE_VERSION}_amd64.deb python3-venv && \
sudo pip3 install -r requirements.txt
shell: bash
env:
RENODE_VERSION: "1.13.3"
- id: create-pip-virtual-environment
run: cd ${GITHUB_ACTION_PATH} && mkdir -p venv-dir && python3 -m venv venv-dir
shell: bash
- id: test
run: |
cd ${GITHUB_ACTION_PATH} && sudo python3 action/run-in-renode.py \
'${{ toJSON(inputs) }}' "${GITHUB_WORKSPACE}" "$ACTION_REPO" "$ACTION_REF"
shell: bash
env:
# https://github.com/orgs/community/discussions/49245
ACTION_REPO: ${{ github.action_repository || github.repository }}
ACTION_REF: ${{ github.action_ref || github.ref_name }}