-
Notifications
You must be signed in to change notification settings - Fork 41
180 lines (156 loc) · 5.46 KB
/
cypress.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
name: E2E Tests
on:
workflow_call:
workflow_dispatch:
schedule:
- cron: "0 12 * * *"
# workflow_run:
# workflows: ["Build PaddleLabel package"]
# branches: [develop]
# types:
# - completed
jobs:
e2e_test:
runs-on: ${{ matrix.os }}
timeout-minutes: 80
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
node-version: ["19.x"]
python-version: ["3.11", "3.10", "3.9", "3.8", "3.7"]
os: [ubuntu-latest, windows-latest, macos-latest]
# python-version: ["3.11"]
# os: [ubuntu-latest]
fail-fast: false
steps:
- name: Setup mamba env ${{ matrix.python-version }}
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: false
environment-name: PaddleLabel
extra-specs: |
python=${{ matrix.python-version }}
cache-env: true
channels: conda-forge
- name: Event type is ${{ github.event_name }}
run: echo ${{ github.event_name }}
- name: Download built paddlelabel package
if: github.event_name == 'push'
uses: actions/download-artifact@v3
with:
name: PaddleLabel_built_package
- name: Parallel - download 3rd party tests and install paddlelabel
run: |
# echo ${{ steps.download_whl.outputs }}
{
mkdir -p ~/测试路径/3rd_party/
cd ~/测试路径/3rd_party/
curl -LO https://github.com/linhandev/static/releases/download/PaddleLabel%E7%9B%B8%E5%85%B3/paddlelabel_3rd_party_tests.zip
echo ----------------------------------
unzip -q paddlelabel_3rd_party_tests.zip
} &
bgid=$!
echo $bgid
# download latest build
if [[ ${{ github.event_name }} != push ]]
then
curl -LO https://nightly.link/PaddleCV-SIG/PaddleLabel/workflows/build/develop/PaddleLabel_built_package.zip
unzip PaddleLabel_built_package.zip
fi
# install latest build
echo ========================================================
pip uninstall paddlelabel -y
pip uninstall paddlelabel -y
pip install paddlelabel-*-py3-none-any.whl
# wait for bg job
wait $bgid
res=$?
# ls ~/测试路径/3rd_party/
if [ $res -ne 0 ]
then
exit $res
fi
- name: Checkout frontend project
uses: actions/checkout@v3
with:
repository: PaddleCV-SIG/PaddleLabel-Frontend
ref: develop
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Download last run screenshots
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: cypress.yml
workflow_conclusion: failure
name: Cypress_test_logs_${{ matrix.os }}_${{ matrix.python-version }}
path: ../
if_no_artifact_found: ignore
- name: Get failed tests, run them first later
id: test_order
run: |
cd ..
if [ -f Cypress_test_logs_${{ matrix.os }}_${{ matrix.python-version }}.tar.gz ]
then
tar -xvf Cypress_test_logs_${{ matrix.os }}_${{ matrix.python-version }}.tar.gz
fi
cd -
# pwd
# ls
echo "tests=$(python cypress/order_tests.py)" >> $GITHUB_OUTPUT
- name: Install cypress env
uses: cypress-io/github-action@v5
with:
working-directory: ./cypress
runTests: false
- name: Run tests
uses: Wandalen/wretry.action@master
id: test
with:
action: cypress-io/github-action@v5
with: |
install: false
working-directory: ./cypress
browser: chrome
config: baseUrl=http://127.0.0.1:1111
env: os=${{ matrix.os }}
wait-on: http://127.0.0.1:1111
wait-on-timeout: 120
start-windows: "yarn run win:ci"
start: "yarn run unix:ci"
spec: ${{ steps.test_order.outputs.tests }}
attempt_limit: 3
# - name: Run tests
# uses: cypress-io/github-action@v5
# id: test
# with:
# working-directory: ./cypress
# browser: chrome
# config: baseUrl=http://localhost:1111
# env: os=${{ matrix.os }}
# spec: ${{ steps.test_order.outputs.tests }}
# wait-on: "http://localhost:1111"
# wait-on-timeout: 120
# start-windows: yarn run test:win
# start: yarn run test:unix
- name: Uninstall PaddleLabel
run: pip uninstall -y paddlelabel || echo "Can't uninstall paddlelabel"
- name: Backend logs, cypress screenshots
if: failure()
run: |
cd ./cypress/cypress/
tar_name=Cypress_test_logs_${{ matrix.os }}_${{ matrix.python-version }}.tar.gz
tar -czvf $tar_name *
ls -lah $tar_name
echo https://transfer.sh/$tar_name
curl --upload-file "$tar_name" "https://transfer.sh/$tar_name"
- name: Upload run logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: Cypress_test_logs_${{ matrix.os }}_${{ matrix.python-version }}
path: |
./cypress/cypress/Cypress_test_logs_${{ matrix.os }}_${{ matrix.python-version }}.tar.gz