Skip to content

Commit

Permalink
Add build/test workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
  • Loading branch information
gaiksaya committed Aug 16, 2024
1 parent 8342667 commit b189e50
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/keycloak-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Keycloak Build and Test

on:
pull_request:
paths:
- keycloak/**

jobs:
build-and-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: keycloak

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v4
with:
node-version: 16.x

- name: Run CDK Build and Test
run: |
npm install
npm run build
- name: Run test coverage
run: |
npm test -- --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
2 changes: 1 addition & 1 deletion keycloak/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Welcome to your CDK TypeScript project
# CDK to deploy Keycloak infrastructure

This is a blank project for CDK development with TypeScript.

Expand Down
4 changes: 2 additions & 2 deletions keycloak/lib/all-stacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class AllStacks extends Stack {
InitPackage.yum('docker'),
InitCommand.shellCommand('sudo curl -L https://github.com/docker/compose/releases/download/v2.9.0/docker-compose-$(uname -s)-$(uname -m) '
+ '-o /usr/bin/docker-compose && sudo chmod +x /usr/bin/docker-compose'),
InitFile.fromFileInline('/docker-compose.yml', join(__dirname, '../../resources/docker-compose.yml')),
InitFile.fromFileInline('/docker-compose.yml', join(__dirname, '../resources/docker-compose.yml')),
InitCommand.shellCommand('touch /.env'),
InitCommand.shellCommand(`echo KC_DB_PASSWORD=$(aws --region ${region} secretsmanager get-secret-value`
+ ` --secret-id ${props.keycloakDBpasswordSecretArn} --query SecretString --output text) > /.env && `
Expand All @@ -108,7 +108,7 @@ export class AllStacks extends Stack {
InitPackage.yum('docker'),
InitCommand.shellCommand('sudo curl -L https://github.com/docker/compose/releases/download/v2.9.0/docker-compose-$(uname -s)-$(uname -m) '
+ '-o /usr/bin/docker-compose && sudo chmod +x /usr/bin/docker-compose'),
InitFile.fromFileInline('/docker-compose.yml', join(__dirname, '../../resources/internal-docker-compose.yml')),
InitFile.fromFileInline('/docker-compose.yml', join(__dirname, '../resources/internal-docker-compose.yml')),
InitCommand.shellCommand('touch /.env'),
InitCommand.shellCommand(`echo KC_DB_PASSWORD=$(aws --region ${region} secretsmanager get-secret-value`
+ ` --secret-id ${props.keycloakDBpasswordSecretArn} --query SecretString --output text) > /.env && `
Expand Down

0 comments on commit b189e50

Please sign in to comment.