forked from omnetpp/opp_env
-
Notifications
You must be signed in to change notification settings - Fork 0
189 lines (154 loc) · 4.95 KB
/
external.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
180
181
182
183
184
185
186
187
188
189
name: External projects test
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
workflow_dispatch:
jobs:
create-combinations:
name: Create project combinations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install locally
run: python3 -m pip install -e .
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: list all test sessions
id: set-matrix
run: |
projects=$(opp_env list --flat | grep -P '^(?!(omnetpp|inet|simulte|simu5g|veins))')
if [ -z "$projects" ]; then
echo "::set-output name=matrix::[]"
else
# Create a JSON array directly
json_array=$(echo "$projects" | awk '{printf "\"%s\",", $0}' | sed 's/,$//')
json_array="[$json_array]"
echo "::set-output name=matrix::$json_array"
fi
- name: Debug output
run: echo "${{ steps.set-matrix.outputs.matrix }}"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
# smoketests:
# needs: create-combinations
# strategy:
# fail-fast: false
# matrix:
# projects: ${{ fromJson(needs.create-combinations.outputs.matrix) }}
# name: Smoke test ${{ matrix.projects }}
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.x"
# - name: Install locally
# run: python3 -m pip install -e .
# - uses: cachix/install-nix-action@v30
# with:
# nix_path: nixpkgs=channel:nixos-unstable
# - name: Install Xvfb
# run: |
# sudo apt-get update
# sudo apt-get install -y xvfb
# - name: Start Xvfb
# run: Xvfb :99 -screen 0 1024x768x24 &
# - name: Set DISPLAY variable
# run: echo "DISPLAY=:99" >> $GITHUB_ENV
# # - name: Check for wish
# # run: |
# # TMPDIR=${TMPDIR:-/tmp}
# # WORKSPACE=$(mktemp -d $TMPDIR/opp_env_test_XXXXXX)
# # opp_env run --install --no-build omnetpp-4.0 -w $WORKSPACE --init -c "which wish || echo 'wish not found'"
# # echo $DISPLAY
# - name: Run test
# working-directory: tests
# run: ./project_tester --workspace /tmp/${{ matrix.projects }} install ${{ matrix.projects }}
# - name: ldd
# if: always()
# working-directory: /tmp/${{ matrix.projects }}
# run: |
# cd omnetpp-6.1.0/samples/dyna
# ldd dyna
# - name: makefile.inc config.log
# if: always()
# working-directory: /tmp/${{ matrix.projects }}
# run: |
# cd omnetpp-6.1.0
# cat Makefile.inc
# echo '------------------------------'
# cat config.log
# - name: Show output
# if: always()
# run: |
# echo "::group::Output"
# cat tests/logs/${{ matrix.projects }}.out || echo '(no output)'
# echo "::endgroup::"
# echo "::group::Error"
# cat tests/logs/${{ matrix.projects }}.err || echo '(no output)'
# echo "::endgroup::"
omnetpp61:
name: Smoke test omnetpp
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install locally
run: python3 -m pip install -e .
- uses: cachix/install-nix-action@v30
# with:
# nix_path: nixpkgs=channel:nixos-unstable
- name: Install Xvfb
run: |
sudo apt-get update
sudo apt-get install -y xvfb
- name: Start Xvfb
run: Xvfb :99 -screen 0 1024x768x24 &
- name: Set DISPLAY variable
run: echo "DISPLAY=:99" >> $GITHUB_ENV
# - name: Check for wish
# run: |
# TMPDIR=${TMPDIR:-/tmp}
# WORKSPACE=$(mktemp -d $TMPDIR/opp_env_test_XXXXXX)
# opp_env run --install --no-build omnetpp-4.0 -w $WORKSPACE --init -c "which wish || echo 'wish not found'"
# echo $DISPLAY
- name: Run test
working-directory: tests
run: ./project_tester --workspace /tmp/omnetpp install omnetpp-6.1.0 --build-modes debug
- name: ldd
if: always()
working-directory: /tmp/omnetpp
run: |
cd omnetpp-6.1.0/samples/dyna
ldd dyna
- name: makefile.inc config.log
if: always()
working-directory: /tmp/omnetpp
run: |
cd omnetpp-6.1.0
cat Makefile.inc
echo '------------------------------'
cat config.log
- name: Show output
if: always()
run: |
echo "::group::Output"
cat tests/logs/omnetpp.out || echo '(no output)'
echo "::endgroup::"
echo "::group::Error"
cat tests/logs/omnetpp.err || echo '(no output)'
echo "::endgroup::"