Skip to content

Commit 3b21dcc

Browse files
committed
ci: add E2E tests and new example apps test workflow; remove outdated pull-request workflow
1 parent 85b203c commit 3b21dcc

3 files changed

Lines changed: 18 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,26 @@ jobs:
3131
wait
3232
3333
- name: Build
34+
if: always()
3435
run: npm run build
3536

3637
- name: Test
38+
if: always()
3739
run: npm test
3840

41+
- name: E2E tests
42+
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 }}
51+
3952
- name: Check commits (PR only)
40-
if: github.event_name == 'pull_request'
53+
if: github.event_name == 'pull_request' && always()
4154
run: |
4255
npx commitlint \
4356
--from ${{ github.event.pull_request.base.sha }} \

.github/workflows/pull-request.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/run-tests-example-apps.yml renamed to .github/workflows/test-example-apps.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run tests for example apps
1+
name: Test for example apps
22

33
on:
44
workflow_dispatch:
@@ -18,7 +18,7 @@ permissions:
1818
pull-requests: write
1919

2020
jobs:
21-
run-tests-example-apps:
21+
test-example-apps:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout
@@ -47,9 +47,10 @@ jobs:
4747
if: inputs.update-screenshots == 'true'
4848
run: cd examples/tests && npm test -- --update-snapshots
4949

50-
5150
- name: Upload screenshots
5251
if: inputs.update-screenshots == 'true'
52+
env:
53+
GH_TOKEN: ${{ secrets.SUPERDOC_PAT }}
5354
run: |
5455
git config --global user.name "github-actions[bot]"
5556
git config --global user.email "github-actions[bot]@users.noreply.github.com"

0 commit comments

Comments
 (0)