Run e2e tests #43
Workflow file for this 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
name: Run e2e tests | |
on: | |
workflow_dispatch: | |
inputs: | |
prNumber: | |
description: "(Optional) PR Number. If you specify a value here, the value of the branch field will be ignored." | |
required: false | |
default: "" | |
env: | |
NODE_VERSION: 18 | |
jobs: | |
run-e2e-tests: | |
runs-on: ubuntu-latest | |
env: | |
NODE_ENV: dev | |
PR_NUMBER: ${{ inputs.prNumber }} | |
permissions: | |
id-token: write # needed to interact with GitHub's OIDC Token endpoint. | |
contents: write | |
strategy: | |
matrix: | |
suite: [processing, storage, governance, utils] | |
fail-fast: false | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
# If we pass a PR Number when triggering the workflow we will retrieve the PR info and get its headSHA | |
- name: Extract PR details | |
id: extract_PR_details | |
if: ${{ inputs.prNumber != '' }} | |
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | |
with: | |
script: | | |
const script = require('.github/scripts/get-pr-info.js'); | |
await script({github, context, core}); | |
# Only if a PR Number was passed and the headSHA of the PR extracted, | |
# we checkout the PR at that point in time | |
- name: Checkout PR code | |
if: ${{ inputs.prNumber != '' }} | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
with: | |
ref: ${{ steps.extract_PR_details.outputs.headSHA }} | |
- name: Setup NodeJS and dependency cache | |
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'yarn' | |
cache-dependency-path: | | |
yarn.lock | |
framework/yarn.lock | |
solutions/yarn.lock | |
- name: Install dependencies | |
run: yarn install --check-files --frozen-lockfile | |
- name: Build | |
run: npx projen build | |
- name: Setup AWS credentials | |
uses: aws-actions/configure-aws-credentials@04b98b3f9e85f563fb061be8751a0352327246b0 # v3.0.1 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }} | |
aws-region: eu-west-1 | |
role-duration-seconds: 7200 | |
- name: Run e2e tests | |
run: cd framework && npx jest --group=e2e/${{ matrix.suite }} |