-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
92 lines (82 loc) · 3.28 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
name: 'Test Sunbeam Extension'
description: 'Test full run of sunbeam extension'
inputs:
sunbeam-version:
description: 'Branch or tag of sunbeam to install'
required: false
default: 'main'
install-options:
description: 'Options to be passed to the sunbeam install script'
required: false
default: ''
extension-full-name:
description: 'Full name of this extension (e.g. sunbeam-labs/sbx_template or Ulthran/sbx_demic)'
required: false
default: ${{ github.event.pull_request.head.repo.full_name }}
extension-branch-name:
description: 'Branch name of extension to be tested (e.g. main or 1-feature-branch)'
required: false
default: ${{ github.head_ref }}
other-extensions:
description: 'Any other extensions needed to run this one (use comma-separated string like "sunbeam-labs/sbx_one,other-user/sbx_two")'
required: false
default: ''
test-directory:
description: 'Directory that contains e2e tests which need all of sunbeam to run'
required: false
default: '.tests/e2e/'
runs:
using: "composite"
steps:
- name: setup-conda
uses: s-weigand/setup-conda@v1.1.0
with:
# Additional channels like 'conda-forge' which can be used to install packages
conda-channels: '' # optional, default is
- name: Install Pytest
shell: bash
run: python -m pip install -U pytest
- name: Install Sunbeam
shell: bash
env:
INSTALL_OPTIONS: ${{ inputs.install-options }}
run: |
git clone --depth 1 --branch ${{ inputs.sunbeam-version }} https://github.com/sunbeam-labs/sunbeam sunbeam
cd sunbeam
bash install.sh -e sunbeam -v $INSTALL_OPTIONS
- name: Install Extensions
shell: bash
env:
BRANCH_NAME: ${{ inputs.extension-branch-name }}
EXTENSION_FULL_NAME: ${{ inputs.extension-full-name }}
EXTENSIONS_LIST: ${{ inputs.other-extensions }}
run: |
if [ -z "${EXTENSION_FULL_NAME}" ]
then
URL=${{ github.event.repository.url }}
ARR=(${URL//// })
EXTENSION_FULL_NAME="${ARR[-2]}/${ARR[-1]}"
fi
echo "BRANCH_NAME: $BRANCH_NAME" >> $GITHUB_STEP_SUMMARY
echo "EXTENSION_FULL_NAME: $EXTENSION_FULL_NAME" >> $GITHUB_STEP_SUMMARY
echo "EXTENSIONS_LIST: $EXTENSIONS_LIST" >> $GITHUB_STEP_SUMMARY
cd sunbeam
source activate sunbeam
for i in ${EXTENSIONS_LIST//,/ }
do
sunbeam extend https://github.com/$i
done
ARR=(${EXTENSION_FULL_NAME//// })
EXTENSION_NAME=${ARR[1]}
if [ -z "${BRANCH_NAME}" ]
then
git clone https://github.com/$EXTENSION_FULL_NAME extensions/$EXTENSION_NAME
else
git clone -b $BRANCH_NAME https://github.com/$EXTENSION_FULL_NAME extensions/$EXTENSION_NAME
fi
- name: Run Tests
shell: bash
run: |
source activate sunbeam
pytest -vvvv -l --tb=long ${{ inputs.test-directory }} 2>&1 | tee pytest_output.txt
sed -n '/================================= FAILURES =================================/q;p' pytest_output.txt >> $GITHUB_STEP_SUMMARY