Skip to content

feat: integrate AWS WAF Captcha #2298

feat: integrate AWS WAF Captcha

feat: integrate AWS WAF Captcha #2298

Workflow file for this run

name: CI
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
workflow_dispatch:
env:
REACT_APP_TEST_STUDENT1_PASSWORD: ${{ secrets.STUDENT1_PASSWORD }}
REACT_APP_TEST_TEACHER1_PASSWORD: ${{ secrets.TEACHER1_PASSWORD }}
REACT_APP_TEST_MANAGER1_PASSWORD: ${{ secrets.MANAGER1_PASSWORD }}
REACT_APP_TEST_MONITOR1_PASSWORD: ${{ secrets.MONITOR1_PASSWORD }}
REACT_APP_AWS_REGION: eu-west-3
REACT_APP_USERPOOL_ID: ${{ vars.PREPROD_USERPOOL_ID }}
REACT_APP_WEBCLIENT_ID: ${{ vars.PREPROD_WEBCLIENT_ID }}
REACT_APP_OAUTH_DOMAIN: ${{ vars.PREPROD_OAUTH_DOMAIN }}
jobs:
style:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.19.0
## Connect to Numer Private Codeartifact Repository ##
- name: Configure prod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
- run: sh ./initNpmrc.sh hei-store npm-hei-school 088312068315
## Connect to Numer Private Codeartifact Repository ##
- name: Configure preprod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PREPROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PREPROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
unset-current-credentials: true
- run: sh ./initNpmrc.sh hei-store npm-hei-lab 057045785189
## Install npm dependencies ##
- name: Install npm dependencies
run: npm ci
## Run prettier to check code style ##
- name: Check style
run: npm run format:check
test-e2e:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.19.0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
## Connect to Numer Private Codeartifact Repository ##
- name: Configure prod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
- run: sh ./initNpmrc.sh hei-store npm-hei-school 088312068315
## Connect to Numer Private Codeartifact Repository ##
- name: Configure preprod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PREPROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PREPROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
unset-current-credentials: true
- run: sh ./initNpmrc.sh hei-store npm-hei-lab 057045785189
- run: npm install --location=global sonar-scanner
## Read version file ##
- name: Read version file
if: always()
id: read-version
uses: CumulusDS/[email protected]
with:
file: version.yml
version: version
## Run Cypress e2e tests ##
- name: Run e2e tests
uses: cypress-io/github-action@v6
with:
start: npm run dev
## Merge test reports ##
- name: Merge test reports
if: always()
run: |
npm run test:merge:reports
## SonarQube Cloud Scan ##
- name: SonarQube Cloud Scan
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_FOR_CONVENTIONAL_CHANGELOG }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner \
-Dsonar.projectVersion=${{ steps.read-version.outputs.version }} \
-Dsonar.host.url=https://sonarcloud.io \
build:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.19.0
## Connect to Numer Private Codeartifact Repository ##
- name: Configure prod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
- run: sh ./initNpmrc.sh hei-store npm-hei-school 088312068315
## Connect to Numer Private Codeartifact Repository ##
- name: Configure preprod AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.PREPROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PREPROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REACT_APP_AWS_REGION }}
unset-current-credentials: true
- run: sh ./initNpmrc.sh hei-store npm-hei-lab 057045785189
## Install npm dependencies ##
- name: Install npm dependencies
run: npm ci
## Build the application with vite and typescript ##
- name: Build app
run: npm run build