-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
407 additions
and
399 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs. | ||
# More information at https://editorconfig.org | ||
|
||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true | ||
|
||
# Matches multiple files with brace expansion notation | ||
# Set default charset | ||
[*.{js,ts,jsx,tsx,html,css,scss,json,yml,yaml,md}] | ||
charset = utf-8 | ||
|
||
# 4 space indentation for TypeScript files | ||
[*.ts] | ||
indent_size = 4 | ||
|
||
# 2 space indentation for YAML files | ||
[*.{yml,yaml}] | ||
indent_size = 2 | ||
# 2 space indentation for JSON files | ||
[*.json] | ||
indent_size = 2 | ||
|
||
# 2 space indentation for Markdown files | ||
[*.md] | ||
indent_size = 2 | ||
|
||
# 2 space indentation for HTML files | ||
[*.html] | ||
indent_size = 2 | ||
|
||
# 2 space indentation for CSS and SCSS files | ||
[*.{css,scss}] | ||
indent_size = 2 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build and push | ||
description: Build and push Docker images to Docker Hub | ||
|
||
inputs: | ||
environment: | ||
description: "Environment to build images for" | ||
required: true | ||
service: | ||
description: "Service to build and push" | ||
required: true | ||
dockerhub_username: | ||
description: "Docker Hub username" | ||
required: true | ||
dockerhub_token: | ||
description: "Docker Hub token" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check inputs | ||
shell: bash | ||
if: ${{ inputs.environment != 'dev' && inputs.environment != 'prod' }} | ||
run: echo "Wrong environment. Expected 'dev' or 'prod', got '${{ inputs.environment }}'" && exit 1 | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ inputs.dockerhub_username }} | ||
password: ${{ inputs.dockerhub_token }} | ||
|
||
- name: Build and push backend image | ||
shell: bash | ||
run: | | ||
docker build -t pierrecastro/healthcheck-${{ matrix.service }}:${{ inputs.environment }} ${{ matrix.service }} | ||
docker push pierrecastro/healthcheck-${{ matrix.service }}:${{ inputs.environment }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Compile and push dev images | ||
|
||
on: | ||
push: | ||
branches: ["develop"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
service: [frontend, backend] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build and push dev images | ||
uses: ./.github/actions/build-and-push | ||
with: | ||
environment: "dev" | ||
service: ${{ matrix.service }} | ||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Compile and push prod images | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
service: [frontend, backend] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build and push prod images | ||
uses: ./.github/actions/build-and-push | ||
with: | ||
environment: "prod" | ||
service: ${{ matrix.service }} | ||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
backend_integration: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: backend/tests/integration | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Run backend, APIgateway and database services in a dedicated container | ||
run: docker compose -f docker-compose.yml up -d | ||
- name: Install dependencies | ||
run: npm i | ||
- name: Run backend tests | ||
run: npm run test | ||
|
||
fontend_unit: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: frontend | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: npm i | ||
- name: Run frontend tests | ||
run: npm run test | ||
|
||
e2e: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: e2e | ||
if: false # Disable e2e tests, deprecated at the moment | ||
timeout-minutes: 2 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Run backend, frontend, APIgateway and database services in a dedicated container | ||
run: docker compose -f docker-compose.yml up -d | ||
- name: Run e2e tests | ||
run: docker compose exec playwright npx playwright test |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.