forked from omnetpp/opp_env
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (83 loc) · 2.81 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
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: echo "::set-output name=matrix::$(opp_env list --flat | grep -P '^(?!(omnetpp|inet|simulte|simu5g|veins))')"
# # run: echo "::set-output name=matrix::[$(opp_env list --flat | grep -P '^(?!(omnetpp|inet|simulte|simu5g|veins))' | jq -R . | jq -s .)]"
# - name: Debug output
# run: echo "${{ steps.set-matrix.outputs.matrix }}"
# # save the list into the outputs
# outputs:
# matrix: ${{ steps.set-matrix.outputs.matrix }}
- 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: run smoke test
working-directory: tests
run: ./project_tester --dry-run install ${{ matrix.projects }}
# - name: display matrix
# run: echo ${{ matrix.projects }}
# - name: Show output
# if: always()
# run: |
# echo "::group::Output"
# cat tests/out.txt || echo '(no output)'
# echo "::endgroup::"
# echo "::group::Cumulative output"
# cat tests/cumulative_out.txt || echo '(no output)'
# echo "::endgroup::"