-
-
Notifications
You must be signed in to change notification settings - Fork 41
60 lines (60 loc) · 2.04 KB
/
smoketest.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
name: Playwright Tests against open-vsx.org
on:
push:
branches:
- production
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: open-vsx.org
- uses: actions/checkout@v4
with:
repository: eclipse/openvsx
path: openvsx
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install dependencies
working-directory: ./openvsx/webui
run: yarn
- name: Install Playwright Browsers
working-directory: ./openvsx/webui
run: yarn playwright install --with-deps
- name: Get server version
id: read_version
run: |
read -r line < ./open-vsx.org/Dockerfile
version="${line:19}"
echo "version=${line:19}" >> "$GITHUB_OUTPUT"
- name: Wait 10 minutes for deployment
run: sleep 10m
- name: Get running server version
id: running_version
uses: fjogeleit/http-request-action@v1
with:
url: "https://open-vsx.org/api/version"
method: GET
- name: Check new server deployment is running
id: check_version
run: |
echo "is_version=${{ steps.running_version.outputs.status == 200 && fromJson(steps.running_version.outputs.response).version == steps.read_version.outputs.version }}" >> "$GITHUB_OUTPUT"
- name: Run Playwright tests
if: steps.check_version.outputs.is_version == 'true'
working-directory: ./openvsx/webui
run: yarn smoke-tests
- uses: actions/upload-artifact@v4
if: steps.check_version.outputs.is_version == 'true'
with:
name: playwright-report
path: openvsx/webui/playwright-report/
retention-days: 30
- name: Fail smoke test
if: steps.check_version.outputs.is_version != 'true'
uses: actions/github-script@v7
with:
script: |
core.setFailed('Deployed version is not ${{ steps.read_version.outputs.version }}')