-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into feature/implicated-systems
- Loading branch information
Showing
30 changed files
with
841 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,8 @@ jobs: | |
NOTIFICATIONS_SENDER_NAME: Test Preview | ||
NOTIFICATIONS_SENDER: [email protected] | ||
SITE_URL: http://localhost:8000 | ||
NEXTAUTH_URL: http://localhost:8000 | ||
NEXTAUTH_SECRET: dummy | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,11 +84,9 @@ jobs: | |
GATSBY_ALGOLIA_SEARCH_KEY: ${{ vars.GATSBY_ALGOLIA_SEARCH_KEY }} | ||
GATSBY_AVAILABLE_LANGUAGES: ${{ vars.GATSBY_AVAILABLE_LANGUAGES }} | ||
GATSBY_REALM_APP_ID: ${{ vars.GATSBY_REALM_APP_ID }} | ||
GOOGLE_TRANSLATE_API_KEY: ${{ secrets.GOOGLE_TRANSLATE_API_KEY }} | ||
MONGODB_CONNECTION_STRING: mongodb://127.0.0.1:4110/ | ||
MONGODB_TRANSLATIONS_CONNECTION_STRING: mongodb://127.0.0.1:4110/ | ||
MONGODB_MIGRATIONS_CONNECTION_STRING: mongodb://127.0.0.1:4110/ | ||
TRANSLATE_SUBMISSION_DATE_START: ${{ vars.TRANSLATE_SUBMISSION_DATE_START }} | ||
GATSBY_REALM_APP_GRAPHQL_URL: ${{ secrets.GATSBY_REALM_APP_GRAPHQL_URL }} | ||
GATSBY_PRISMIC_REPO_NAME: ${{ vars.GATSBY_PRISMIC_REPO_NAME }} | ||
PRISMIC_ACCESS_TOKEN: ${{ secrets.PRISMIC_ACCESS_TOKEN }} | ||
|
@@ -137,6 +135,8 @@ jobs: | |
NOTIFICATIONS_SENDER_NAME: Test Preview | ||
NOTIFICATIONS_SENDER: [email protected] | ||
SITE_URL: http://localhost:8000 | ||
NEXTAUTH_URL: http://localhost:8000 | ||
NEXTAUTH_SECRET: 678x1irXYWeiOqTwCv1awvkAUbO9eHa5xzQEYhxhMms= # only used in local tests | ||
|
||
- name: Upload Playwright traces | ||
if: failure() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,8 @@ jobs: | |
NOTIFICATIONS_SENDER_NAME: Test Preview | ||
NOTIFICATIONS_SENDER: [email protected] | ||
SITE_URL: http://localhost:8000 | ||
NEXTAUTH_URL: http://localhost:8000 | ||
NEXTAUTH_SECRET: 678x1irXYWeiOqTwCv1awvkAUbO9eHa5xzQEYhxhMms= # only used in local tests | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
name: Run tests | ||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
description: The Github environment to load secrets from | ||
type: string | ||
required: true | ||
sha: | ||
description: The commit SHA to run the tests against | ||
type: string | ||
required: true | ||
runner-label: | ||
description: The label of the runner to use | ||
type: string | ||
cache-modifier: | ||
description: A modifier for the cache key used to bypass existing cache | ||
type: string | ||
required: false | ||
default: "" | ||
|
||
jobs: | ||
test: | ||
name: Run Cypress tests | ||
environment: ${{ inputs.environment }} | ||
runs-on: | ||
labels: ${{ inputs.runner-label || 'ubuntu-latest' }} | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: site/gatsby-site | ||
strategy: | ||
# when one test fails, DO NOT cancel the other | ||
# containers, because this will kill Cypress processes | ||
# leaving the Dashboard hanging ... | ||
# https://github.com/cypress-io/github-action/issues/48 | ||
fail-fast: false | ||
matrix: | ||
# run 4 copies of the current job in parallel | ||
containers: [1, 2, 3, 4] | ||
# stop the job if it runs over 20 minutes | ||
# to prevent a hanging process from using all your CI minutes | ||
timeout-minutes: 80 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.sha }} | ||
|
||
- name: Read node modules from cache | ||
id: cache-nodemodules | ||
uses: actions/cache/restore@v4 | ||
env: | ||
cache-name: cache-install-folder | ||
with: | ||
path: | | ||
site/gatsby-site/node_modules | ||
~/.cache/Cypress | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}-${{ inputs.cache-modifier }} | ||
|
||
- name: Install NPM dependencies | ||
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
working-directory: site/gatsby-site | ||
runTests: false | ||
install-command: npm ci | ||
|
||
- name: Restore build cache | ||
uses: actions/cache/restore@v4 | ||
env: | ||
cache-name: cache-build-folder | ||
with: | ||
path: | | ||
site/gatsby-site/public | ||
site/gatsby-site/netlify/functions | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ inputs.sha }}-${{ inputs.cache-modifier }} | ||
|
||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV | ||
id: extract_branch | ||
|
||
- name: Cypress run | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
working-directory: site/gatsby-site | ||
install: false | ||
config-file: cypress.config.js | ||
record: true | ||
parallel: true | ||
group: "Cypress e2e tests" | ||
tag: ${{ steps.extract_branch.outputs.branch }} | ||
start: npx -y pm2 start npm --name "web-server" -- run serve && npx pm2 logs "web-server" | ||
wait-on: http://127.0.0.1:8000 | ||
wait-on-timeout: 60 | ||
env: | ||
# Recommended: pass the GitHub token lets this action correctly | ||
# determine the unique run id necessary to re-run the checks | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CYPRESS_PROJECT_ID: ${{ vars.CYPRESS_PROJECT_ID }} | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
E2E_ADMIN_USERNAME: ${{ secrets.E2E_ADMIN_USERNAME }} | ||
E2E_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD }} | ||
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }} | ||
GATSBY_ALGOLIA_APP_ID: ${{ vars.GATSBY_ALGOLIA_APP_ID }} | ||
GATSBY_ALGOLIA_SEARCH_KEY: ${{ vars.GATSBY_ALGOLIA_SEARCH_KEY }} | ||
GATSBY_AVAILABLE_LANGUAGES: ${{ vars.GATSBY_AVAILABLE_LANGUAGES }} | ||
GATSBY_REALM_APP_ID: ${{ vars.GATSBY_REALM_APP_ID }} | ||
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }} | ||
MONGODB_REPLICA_SET: ${{ secrets.MONGODB_REPLICA_SET }} | ||
MONGODB_TRANSLATIONS_CONNECTION_STRING: ${{ secrets.MONGODB_TRANSLATIONS_CONNECTION_STRING }} | ||
MONGODB_MIGRATIONS_CONNECTION_STRING: ${{ secrets.MONGODB_MIGRATIONS_CONNECTION_STRING }} | ||
GATSBY_REALM_APP_GRAPHQL_URL: ${{ secrets.GATSBY_REALM_APP_GRAPHQL_URL }} | ||
GATSBY_ROLLBAR_TOKEN: ${{ secrets.GATSBY_ROLLBAR_TOKEN }} | ||
INSTRUMENT: true | ||
# Since this is triggered on a pull request, we set the commit message to the pull request title | ||
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} | ||
CLOUDFLARE_R2_ACCOUNT_ID: ${{ vars.CLOUDFLARE_R2_ACCOUNT_ID }} | ||
CLOUDFLARE_R2_BUCKET_NAME: ${{ vars.CLOUDFLARE_R2_BUCKET_NAME }} | ||
GATSBY_CLOUDFLARE_R2_PUBLIC_BUCKET_URL: ${{ vars.GATSBY_CLOUDFLARE_R2_PUBLIC_BUCKET_URL }} | ||
CLOUDFLARE_R2_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }} | ||
CLOUDFLARE_R2_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }} | ||
REALM_GRAPHQL_API_KEY: ${{ secrets.REALM_GRAPHQL_API_KEY }} | ||
REALM_APP_ID: ${{ secrets.REALM_APP_ID }} | ||
REALM_API_APP_ID: ${{ vars.REALM_API_APP_ID }} | ||
REALM_API_GROUP_ID: ${{ vars.REALM_API_GROUP_ID }} | ||
REALM_API_PUBLIC_KEY: ${{ secrets.REALM_API_PUBLIC_KEY }} | ||
REALM_API_PRIVATE_KEY: ${{ secrets.REALM_API_PRIVATE_KEY }} | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Translate Reports - Production | ||
|
||
on: | ||
schedule: | ||
- cron: "0 5 * * *" # Run every day at 5 AM GMT | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
call-translate: | ||
uses: ./.github/workflows/translate.yml | ||
secrets: inherit | ||
with: | ||
environment: production | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Translate Reports - Staging | ||
|
||
on: | ||
schedule: | ||
- cron: "0 5 * * *" # Run every day at 5 AM GMT | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
call-translate: | ||
uses: ./.github/workflows/translate.yml | ||
secrets: inherit | ||
with: | ||
environment: staging | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Translate Reports | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
description: The Github environment to load secrets from | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
translate: | ||
environment: ${{ inputs.environment }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: Install NPM dependencies | ||
run: npm ci | ||
working-directory: site/gatsby-site | ||
|
||
- name: Run translation script | ||
run: npm run translate-reports | ||
working-directory: site/gatsby-site | ||
env: | ||
MONGODB_TRANSLATIONS_CONNECTION_STRING: ${{ secrets.MONGODB_TRANSLATIONS_CONNECTION_STRING }} | ||
GOOGLE_TRANSLATE_API_KEY: ${{ secrets.GOOGLE_TRANSLATE_API_KEY }} | ||
GATSBY_AVAILABLE_LANGUAGES: ${{ vars.GATSBY_AVAILABLE_LANGUAGES }} | ||
TRANSLATE_SUBMISSION_DATE_START: ${{ vars.TRANSLATE_SUBMISSION_DATE_START }} | ||
TRANSLATE_DRY_RUN: ${{ vars.TRANSLATE_DRY_RUN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.