-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yaml
95 lines (90 loc) · 3.55 KB
/
action.yaml
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
name: 'Volttron Build Action'
author: Mark Bonicillo
description: 'Runs Volttron tests suite using Pytest'
branding:
icon: zap
color: green
inputs:
os:
description: os type
required: yes
python_version:
description: python version
required: yes
test_path:
description: path to Volttron test
required: yes
test_output_suffix:
description: suffix for test output
required: yes
# Reference syntax for 'composite' runs: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions
runs:
using: "composite"
steps:
- name: Install Erlang for RabbitMQ
run: |
if [[ "$OS" == 'ubuntu-20.04' ]]; then
echo 'Installing erlang dependencies'
sudo apt-get update
sudo apt-get install -y gnupg apt-transport-https libsctp1
echo 'Clean older version of erlang-base'
sudo apt-get purge -yf erlang-base
echo 'Installing erlang'
if ! [ -f esl-erlang_25.2-1~ubuntu~focal_amd64.deb ]; then
echo "Downloading erlang"
wget https://github.com/VOLTTRON/volttron-build-action/raw/local-erlang/erlang/esl-erlang_25.2-1~ubuntu~focal_amd64.deb
fi
#wget https://binaries2.erlang-solutions.com/ubuntu/pool/contrib/e/esl-erlang/esl-erlang_25.2-1~ubuntu~focal_amd64.deb
sudo dpkg -i esl-erlang_25.2-1~ubuntu~focal_amd64.deb
fi
if [[ "$OS" == 'ubuntu-22.04' ]]; then
echo 'Installing erlang dependencies'
sudo apt-get update
sudo apt-get install -y gnupg apt-transport-https libsctp1
echo 'Clean older version of erlang-base'
sudo apt-get purge -yf erlang-base
echo 'Installing erlang'
if ! [ -f esl-erlang_25.2-1~ubuntu~focal_amd64.deb ]; then
echo "Downloading erlang"
wget https://github.com/VOLTTRON/volttron-build-action/raw/local-erlang/erlang/esl-erlang_25.2-1~ubuntu~jammy_amd64.deb
fi
#wget https://binaries2.erlang-solutions.com/ubuntu/pool/contrib/e/esl-erlang/esl-erlang_25.2-1~ubuntu~jammy_amd64.deb
sudo dpkg -i esl-erlang_25.2-1~ubuntu~jammy_amd64.deb
fi
shell: bash
env:
OS: ${{ inputs.os }}
- name: Install dependencies including rmq
run: |
if [[ ! -f "$FILE" ]] && [[ "$OS" == 'ubuntu-20.04' || "$OS" == 'ubuntu-22.04' ]]; then
echo 'Installing all volttron dependencies and RMQ'
pip install wheel
python bootstrap.py --all --rabbitmq --force
fi
shell: bash
env:
OS: ${{ inputs.os }}
FILE: env/bin/activate
- name: Install volttron
run: |
source env/bin/activate
pip install -e .
shell: bash
- name: Run Volttron tests
run: |
source env/bin/activate
pip install -e .
# Until the requirements.py install this here.
pip install pytest-rerunfailures
pip list
echo "the test path $TEST_PATH and $TEST_OUTPUT_SUFFIX"
# pytest -rf -rf -o junit_family=xunit2 \
# --junitxml=output/test-$TEST_OUTPUT_SUFFIX-${{ inputs.os }}-${{ inputs.python_version }}-results.xml \
# "$TEST_PATH"
pytest --reruns 2 --reruns-delay 5 -rf -o junit_family=xunit2 \
--junitxml=output/test-$TEST_OUTPUT_SUFFIX-${{ inputs.os }}-${{ inputs.python_version }}-results.xml \
"$TEST_PATH"
shell: bash
env:
TEST_PATH: ${{ inputs.test_path }}
TEST_OUTPUT_SUFFIX: ${{ inputs.test_output_suffix }}