Skip to content

Commit d9c3583

Browse files
committed
Added staging tests to CI/CD
closes https://linear.app/ghost/issue/PROD-1779 - Added a CI/CD step that runs tests in staging. This will attempt to catch errors in GCP components before being shipped to production.
1 parent 04c49e6 commit d9c3583

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.github/workflows/cicd.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,17 @@ jobs:
240240
labels: |-
241241
commit-sha=${{ github.sha }}
242242
243+
- name: "Deploy Tests to Cloud Run"
244+
uses: google-github-actions/deploy-cloudrun@v2
245+
with:
246+
image: europe-docker.pkg.dev/ghost-activitypub/activitypub/activitypub:${{ needs.build-test-push.outputs.migrations_docker_version }}
247+
region: europe-west4
248+
job: stg-pr-${{ github.event.pull_request.number }}-tests
249+
flags: --command="yarn" --args "_test:single" --wait --execute-now
250+
skip_default_labels: true
251+
labels: |-
252+
commit-sha=${{ github.sha }}
253+
243254
- name: "Add route to GCP Load Balancer"
244255
if: ${{ steps.check-labels.outputs.is_ephemeral_staging == 'true' }}
245256
env:
@@ -306,6 +317,18 @@ jobs:
306317
labels: |-
307318
commit-sha=${{ github.sha }}
308319
320+
- name: "Deploy Tests to Cloud Run"
321+
if: ${{ matrix.region == 'europe-west4' }}
322+
uses: google-github-actions/deploy-cloudrun@v2
323+
with:
324+
image: europe-docker.pkg.dev/ghost-activitypub/activitypub/activitypub:${{ needs.build-test-push.outputs.migrations_docker_version }}
325+
region: ${{ matrix.region }}
326+
job: stg-${{ matrix.region_name }}-activitypub-tests
327+
flags: --command="yarn _test:single" --wait --execute-now
328+
skip_default_labels: true
329+
labels: |-
330+
commit-sha=${{ github.sha }}
331+
309332
- name: "Deploy ActivityPub Queue to Cloud Run"
310333
uses: google-github-actions/deploy-cloudrun@v2
311334
with:

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ RUN yarn && \
1111
COPY tsconfig.json .
1212

1313
COPY src ./src
14+
COPY vitest.config.ts vitest.config.ts
1415

1516
ENV NODE_ENV=production
1617
RUN yarn build

0 commit comments

Comments
 (0)