Improve EndToEnd test setup #12
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
permissions: | |
contents: read | |
id-token: write | |
on: | |
pull_request: | |
branches: | |
- dev | |
concurrency: | |
group: ${{ github.head_ref }} | |
cancel-in-progress: false | |
name: check | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: check | |
env: | |
SERVICE: ${{ vars.SERVICE }} | |
CDK_DEFAULT_REGION: ${{ vars.CDK_DEFAULT_REGION }} | |
CDK_DEFAULT_ACCOUNT: ${{ vars.CDK_DEFAULT_ACCOUNT }} | |
TAG: ${{ github.event.pull_request.head.sha }} | |
name: build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: npm ci | |
- name: Run detect stage | |
id: vars | |
run: | | |
echo "STAGE=$(echo ${{github.head_ref}} | sed -r 's/[^a-z0-9-]/-/gi' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- run: npm run unit | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::${{ env.CDK_DEFAULT_ACCOUNT }}:role/github-actions | |
role-duration-seconds: 900 | |
aws-region: ${{ env.CDK_DEFAULT_REGION }} | |
- name: Run cdk deploy ecr stack | |
run: npx cdk deploy ${{ env.SERVICE }}-${{ env.STAGE }}-ecr --require-approval never | |
- name: Run login to aws ecr | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
with: | |
mask-password: "true" | |
- run: | | |
npm run build | |
npm run push | |
- name: Run cdk deploy app stack | |
run: npx cdk deploy ${{ env.SERVICE }}-${{ env.STAGE }}-app --require-approval never | |
- run: npm run integration | |
- run: npm run e2e |