Skip to content

Commit 183006a

Browse files
committed
chore: refactor CI workflows; consolidate E2E tests and add PR check workflow
1 parent 3b21dcc commit 183006a

3 files changed

Lines changed: 24 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,9 @@ jobs:
3838
if: always()
3939
run: npm test
4040

41-
- name: E2E tests
41+
- name: Test example apps
4242
if: always()
43-
run: |
44-
curl -L \
45-
-X POST \
46-
-H "Accept: application/vnd.github+json" \
47-
-H "Authorization: Bearer ${{ secrets.SUPERDOC_PAT }}" \
48-
-H "X-GitHub-Api-Version: 2022-11-28" \
49-
-d '{"ref": "main", "inputs": {"superdoc-branch": "${{ github.head_ref }}", "pull-request-url": "${{ github.event.pull_request.html_url }}"}}' \
50-
${{ secrets.SD_TESTS_URL }}
43+
uses: ./.github/workflows/test-example-apps.yml
5144

5245
- name: Check commits (PR only)
5346
if: github.event_name == 'pull_request' && always()

.github/workflows/pr-check.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: PR check [auto]
2+
3+
on:
4+
pull_request:
5+
branches: ["main", "release/**"]
6+
7+
jobs:
8+
run-e2e-tests:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Run E2E tests
12+
run: |
13+
curl -L \
14+
-X POST \
15+
-H "Accept: application/vnd.github+json" \
16+
-H "Authorization: Bearer ${{ secrets.SUPERDOC_PAT }}" \
17+
-H "X-GitHub-Api-Version: 2022-11-28" \
18+
-d '{"ref": "main", "inputs": {"superdoc-branch": "${{ github.head_ref }}", "pull-request-url": "${{ github.event.pull_request.html_url }}"}}' \
19+
${{ secrets.SD_TESTS_URL }}

.github/workflows/test-example-apps.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
name: Test for example apps
1+
name: Test for example apps [auto]
22

33
on:
44
workflow_dispatch:
55
inputs:
66
update-screenshots:
77
description: "Update screenshots"
8+
type: boolean
9+
default: false
810
required: false
9-
default: "false"
10-
11-
# TODO: Enable this when we test this workflow manually
12-
# pull_request:
13-
# branches:
14-
# - develop
1511

1612
permissions:
1713
contents: write

0 commit comments

Comments
 (0)