Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CI workflows #855

Draft
wants to merge 87 commits into
base: ref/project-config
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
0998acb
Introduce setup-node composite
maximilianoertel Oct 7, 2024
970564a
Move composite action to correct directory
maximilianoertel Oct 7, 2024
301da35
Move actions/checkout out of composable
maximilianoertel Oct 7, 2024
60ced16
Fix actions/cache version
maximilianoertel Oct 7, 2024
2da4b2e
Added initial e2e test spec to ci workflow
maximilianoertel Oct 7, 2024
19e62f0
Rename setup job
maximilianoertel Oct 7, 2024
222612d
Remove build step from e2e job
maximilianoertel Oct 7, 2024
e747ffb
Fix secret references
maximilianoertel Oct 7, 2024
45cf123
Disable Cypress node_modules install
maximilianoertel Oct 7, 2024
618fd3e
Switch baseUrl to https
maximilianoertel Oct 7, 2024
227c5bb
Disable e2e matrix
maximilianoertel Oct 7, 2024
7032f29
Merge branch 'ref/project-config' into ref/project-config-ci
maximilianoertel Oct 9, 2024
d85b7da
Merge branch 'ref/project-config' into ref/project-config-ci
maximilianoertel Oct 9, 2024
ab6f905
Set --mode development on vite preview cmd
maximilianoertel Oct 9, 2024
ab4ccd9
Start dotenvx integration into CI pipeline
maximilianoertel Oct 9, 2024
ceddb05
Use PAT for submodule access
maximilianoertel Oct 9, 2024
6960d55
Add dotenvx support to Cypress
maximilianoertel Oct 9, 2024
1d5bb31
Remove redundant baseUrl cypress env var
maximilianoertel Oct 9, 2024
f2e6fc5
Remove cypressDownloads env variable
maximilianoertel Oct 9, 2024
ed8a60e
Set preview port
maximilianoertel Oct 10, 2024
7ad218b
Adjust ci workflow to include partner-admin specs
maximilianoertel Oct 10, 2024
3048f8b
Fix vite/vitest config merging
maximilianoertel Oct 10, 2024
bc9de27
Set browser and adjust spec wildcards
maximilianoertel Oct 10, 2024
8c963c9
Set ci workflow concurrency
maximilianoertel Oct 10, 2024
94cc1aa
Remove baseUrl trailing slash
maximilianoertel Oct 10, 2024
430b013
Adjust node_modules ci caching
maximilianoertel Oct 10, 2024
e8e354c
Remove obsolete Cypress env vars
maximilianoertel Oct 10, 2024
817c64c
Adjust cypress tag and commit message
maximilianoertel Oct 10, 2024
9ab1460
Merge branch 'ref/project-config' into ref/project-config-ci
maximilianoertel Oct 10, 2024
a835c2f
Update env-configs
maximilianoertel Oct 10, 2024
a6496f1
Fix logging config eval
maximilianoertel Oct 10, 2024
ce5aae0
Revert "Remove cypressDownloads env variable"
maximilianoertel Oct 10, 2024
100c401
Revert "Remove redundant baseUrl cypress env var"
maximilianoertel Oct 10, 2024
5f8d81c
Temporarily disable workflows
maximilianoertel Oct 10, 2024
a9653b9
Switch to Cypress docker image
maximilianoertel Oct 10, 2024
69cc474
Fix dotenvx and cypress-fs integration
maximilianoertel Oct 10, 2024
7d96ed4
Fix runner and container definition for e2e tests
maximilianoertel Oct 10, 2024
0705dde
Improve node_modules cache
maximilianoertel Oct 10, 2024
7bf8c3c
Fix typo
maximilianoertel Oct 10, 2024
5618884
Revert Cypress docker container usage
maximilianoertel Oct 10, 2024
48ea7fe
Merge branch 'ref/project-config' into ref/project-config-ci
maximilianoertel Oct 10, 2024
c52543f
Re-enable browser matrix
maximilianoertel Oct 11, 2024
6036abb
Fix browser matrix
maximilianoertel Oct 11, 2024
ddfd202
Enable component tests
maximilianoertel Oct 11, 2024
f0f7ccd
Use docker container for Cypress tests
maximilianoertel Oct 11, 2024
7d80c2e
Switch host for Node compatibility
maximilianoertel Oct 11, 2024
2e8cba3
Add --host flag for Cypress runner
maximilianoertel Oct 11, 2024
a937e37
Add Cypress binary caching
maximilianoertel Oct 11, 2024
c9e2a09
Disable component test container matrix
maximilianoertel Oct 11, 2024
e36fa9f
Bump sharp to 0.33.5
maximilianoertel Oct 11, 2024
e062cd7
Remove Cypress docker images due to incompatibility
maximilianoertel Oct 11, 2024
05ac045
Use cypress/browsers container for Cypress tests
maximilianoertel Oct 11, 2024
1a3a846
Increase container matrix as per Cypress recommendations
maximilianoertel Oct 11, 2024
58b24a9
Enable depdency caching
maximilianoertel Oct 11, 2024
d007ccb
Reduce to initial 2 containers
maximilianoertel Oct 11, 2024
e139afb
Uninstall sharp dependency
maximilianoertel Oct 14, 2024
0ba2e31
Simplify workflow with built-caching
maximilianoertel Oct 14, 2024
d283d28
Add missing build cmd
maximilianoertel Oct 14, 2024
5b12c3d
Add PR environment deloyment step to ci workflow
maximilianoertel Oct 14, 2024
153910e
Use repo var to control deployment feature
maximilianoertel Oct 14, 2024
e89f5ef
Add envUrl retrieval
maximilianoertel Oct 14, 2024
f327e55
Bump env-configs
maximilianoertel Oct 14, 2024
0bce4b9
Mock firekit for unit tests
maximilianoertel Oct 14, 2024
8903c83
Support dotenvx vars in component tests
maximilianoertel Oct 14, 2024
0e8e1ce
Add AppCheck env whitelisting
maximilianoertel Oct 16, 2024
46431ea
Simplify ci workflow env url retrieval
maximilianoertel Oct 17, 2024
3a76c84
Disable firebase-hosting-preview workflow
maximilianoertel Oct 17, 2024
5f03825
Introduce new staging deployment workflow
maximilianoertel Oct 23, 2024
47f7405
Adjust generate-matrix logic
maximilianoertel Oct 23, 2024
34574d5
Fix matrix evaluation
maximilianoertel Oct 23, 2024
d782078
Update matrix logic
maximilianoertel Oct 23, 2024
f6d1a64
Add debug step
maximilianoertel Oct 23, 2024
365b802
Temporarily disable ci workflow
maximilianoertel Oct 23, 2024
eec2f81
Fix default env json structure
maximilianoertel Oct 23, 2024
9eeebe9
Adjust debugging output format
maximilianoertel Oct 23, 2024
c3c2b51
Extend debug steps
maximilianoertel Oct 23, 2024
783eb16
Adjust config extraction
maximilianoertel Oct 23, 2024
1148267
Change config retrieval
maximilianoertel Oct 23, 2024
c78463b
Adjust configuration usage
maximilianoertel Oct 23, 2024
daf7890
Switch back to output
maximilianoertel Oct 23, 2024
f9e80ad
Add missing step id
maximilianoertel Oct 23, 2024
3b86724
Fix config usage
maximilianoertel Oct 23, 2024
1015e8a
Adjust jq cmd
maximilianoertel Oct 23, 2024
659cda8
Rename workflow jobs/steps
maximilianoertel Oct 23, 2024
79b93f8
Add firestore indexes & rules deployment actions
maximilianoertel Nov 5, 2024
461cc6c
Update deployment workflows incl. manifest update
maximilianoertel Nov 5, 2024
630aa8c
Temporarily disable staging deployment steps
maximilianoertel Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.test.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
# -------------------------------------------------------------------------------------------------------------------- #
# Cypress Configuration
# -------------------------------------------------------------------------------------------------------------------- #
# Project ID
CYPRESS_PROJECT_ID=


# -------------------------------------------------------------------------------------------------------------------- #
# Test Configuration
# -------------------------------------------------------------------------------------------------------------------- #
# Clever Auth Credentials
CYPRESS_CLEVER_USERNAME=
CYPRESS_CLEVER_PASSWORD=
Expand Down
43 changes: 43 additions & 0 deletions .github/actions/deploy-firestore-indexes/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– #
# roar-dashboard/deploy-firestore-indexes
# –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– #

name: Deploy Firestore Indexes
description: Deploys the ROAR Firestore indexes to both the admin and assessment projects.
inputs:
admin-service-account-key:
description: 'The admin Firebase service account key to authenticate with.'
required: true
assessment-service-account-key:
description: 'The assessment Firebase service account key to authenticate with.'
required: true
admin-project-id:
description: 'The admin Firebase project ID to deploy the indexes to.'
required: true
assessment-project-id:
description: 'The assessment Firebase project ID to deploy the indexes to.'
required: true

runs:
using: 'composite'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Deploy admin indexes
uses: w9jds/firebase-action@v13
with:
args: deploy --only firestore:indexes
env:
GCP_SA_KEY: ${{ inputs.admin-service-account-key }}
PROJECT_ID: ${{ inputs.admin-project-id }}
PROJECT_PATH: ./firebase/admin

- name: Deploy assessment indexes
uses: w9jds/firebase-action@v13
with:
args: deploy --only firestore:indexes
env:
GCP_SA_KEY: ${{ inputs.assessment-service-account-key }}
PROJECT_ID: ${{ inputs.assessment-project-id }}
PROJECT_PATH: ./firebase/assessment
43 changes: 43 additions & 0 deletions .github/actions/deploy-firestore-rules/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– #
# roar-dashboard/deploy-firestore-rules
# –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– #

name: Deploy Firestore Rules
description: Deploys the ROAR Firestore rules to both the admin and assessment projects.
inputs:
admin-service-account-key:
description: 'The admin Firebase service account key to authenticate with.'
required: true
assessment-service-account-key:
description: 'The assessment Firebase service account key to authenticate with.'
required: true
admin-project-id:
description: 'The admin Firebase project ID to deploy the indexes to.'
required: true
assessment-project-id:
description: 'The assessment Firebase project ID to deploy the indexes to.'
required: true

runs:
using: 'composite'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Deploy admin rules
uses: w9jds/firebase-action@v13
with:
args: deploy --only firestore:rules
env:
GCP_SA_KEY: ${{ inputs.admin-service-account-key }}
PROJECT_ID: ${{ inputs.admin-project-id }}
PROJECT_PATH: ./firebase/admin

- name: Deploy assessment rules
uses: w9jds/firebase-action@v13
with:
args: deploy --only firestore:rules
env:
GCP_SA_KEY: ${{ inputs.assessment-service-account-key }}
PROJECT_ID: ${{ inputs.assessment-project-id }}
PROJECT_PATH: ./firebase/assessment
20 changes: 20 additions & 0 deletions .github/actions/setup-node-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– #
# roar-dashboard/setup-node-environment
# –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– #

name: Setup Node.js environment
description: Sets up environment by installing Node.js and the application's npm dependencies.
runs:
using: 'composite'
steps:
# Install Node.js and cache global npm modules
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

# Install npm dependencies
- name: Install dependencies
run: npm ci
shell: bash
48 changes: 48 additions & 0 deletions .github/actions/update-deployment-manifest/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– #
# roar-dashboard/update-deployment-manifest
# –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– #

name: 'Update Deployment Manifest'
description: 'Updates the deployment manifests in additional ROAR project repositories.'
inputs:
project-name:
description: 'Name of the project'
required: true
project-repo:
description: 'Repository to update'
required: true
token:
description: 'GitHub PAT to access the repository'
required: true
runs:
using: 'composite'
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: ${{ inputs.project-repo }}
token: ${{ inputs.token }}

- name: Update deployment manifest
shell: bash
run: |
branch_name="devops/update-deployment-manifest"
git checkout -b $branch_name || git checkout $branch_name

latest_sha=$(git rev-parse HEAD)
yq e -i ".app.latest = \"$latest_sha\"" deployment-manifest.yml

echo "branch_name=$branch_name" >> $GITHUB_OUTPUT
echo "latest_sha=$latest_sha" >> $GITHUB_OUTPUT

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ inputs.token }}
commit-message: 'Bump yeatmanlab/roar-dashboard to ${{ steps.update-release-manifest.outputs.latest_sha }}'
add-paths: 'deployment-manifest.yml'
branch: ${{ steps.update-release-manifest.outputs.branch_name }}
title: 'Update release manifest target'
body: |
## Summary
This automated PR updates the deployment manifest to the latest yeatmanlab/roar-dashboard target SHA ${{ steps.update-release-manifest.outputs.latest_sha }}.
44 changes: 44 additions & 0 deletions .github/actions/whitelist-appcheck-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– #
# roar-dashboard/whitelist-appcheck-environment
# –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– #

name: Whitelist AppCheck environment
description: Whitelists a preview environment for AppCheck.
inputs:
project-id:
description: 'The Firebase project ID to whitelist the domain for.'
required: true
service-account-key:
description: 'The Firebase service account key to authenticate with.'
required: true
appcheck-site-key:
description: 'The Firebase AppCheck site key to update the domain for.'
required: true
environment-url:
description: 'The URL of the preview environment to whitelist.'
required: true

runs:
using: 'composite'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ inputs.service-account-key }}

- name: Set up Google Cloud CLI
uses: google-github-actions/setup-gcloud@v2
with:
project_id: gse-roar-assessment

- name: Add environment URL to AppCheck whitelist
shell: bash
run: |
CURRENT_DOMAINS=$(gcloud recaptcha keys describe ${{ inputs.appcheck-site-key }} --format="value(webSettings.allowedDomains)" | tr ';' '\n')
NEW_DOMAIN=$(echo ${{ inputs.environment-url }} | sed 's|https://||')
ALL_DOMAINS=$(echo -e "${CURRENT_DOMAINS}\n${NEW_DOMAIN}")
UPDATED_DOMAINS=$(echo "$ALL_DOMAINS" | sort | uniq | paste -sd ',' -)
gcloud recaptcha keys update ${{ inputs.appcheck-site-key }} --domains="$UPDATED_DOMAINS" --web
Loading
Loading