Skip to content

Commit 500f1f9

Browse files
committed
chore: add test projects workflow
1 parent 6fcda38 commit 500f1f9

2 files changed

Lines changed: 51 additions & 2 deletions

File tree

.github/workflows/main.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ jobs:
1414
needs: build
1515
uses: ./.github/workflows/check.yaml
1616

17-
test-integration:
17+
test-demo-projects:
1818
needs: [build, check]
19+
uses: ./.github/workflows/test-demo-projects.yaml
20+
secrets: inherit
21+
22+
test-integration:
23+
needs: [build, check, test-demo-projects]
1924
uses: ./.github/workflows/test-integration.yaml
2025
secrets: inherit
2126

2227
release:
2328
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/canary' || github.ref == 'refs/heads/dx-542-update-to-gha')
24-
needs: [build, check, test-integration]
29+
needs: [build, check, test-demo-projects, test-integration]
2530
permissions:
2631
contents: write
2732
id-token: write
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Run Checks
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
CONTENTFUL_INTEGRATION_TEST_CMA_TOKEN:
7+
required: true
8+
CONTENTFUL_ORGANIZATION_ID:
9+
required: true
10+
CONTENTFUL_SPACE_ID:
11+
required: true
12+
13+
jobs:
14+
test-integration:
15+
runs-on: ubuntu-latest
16+
17+
permissions:
18+
contents: read
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v5
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v6
26+
with:
27+
node-version: '22'
28+
cache: 'npm'
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Restore the build folders
34+
uses: actions/cache/restore@v4
35+
with:
36+
path: |
37+
dist
38+
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}
39+
40+
- name: Run integration tests
41+
run: npm run test:demo-projects
42+
env:
43+
CONTENTFUL_INTEGRATION_TEST_CMA_TOKEN: ${{ secrets.CONTENTFUL_INTEGRATION_TEST_CMA_TOKEN }}
44+
CONTENTFUL_ORGANIZATION_ID: ${{ secrets.CONTENTFUL_ORGANIZATION_ID }}

0 commit comments

Comments
 (0)