-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync branch 'feature-multiinformant' with feature/multiinformant-metapod
This sync come after merge dev branch into feature-multiinformant
- Loading branch information
Showing
71 changed files
with
3,490 additions
and
2,978 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
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: Coverage | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
permissions: | ||
statuses: write | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: KengoTODA/actions-setup-docker-compose@v1 | ||
with: | ||
version: '2.23.3' | ||
|
||
- name: "Get coverage" | ||
run: | | ||
cp .env.default .env | ||
echo -e "\nRABBITMQ__USE_SSL=False" >> .env | ||
make run_local | ||
- run: make ctest | ||
|
||
- run: make creport SHA=${{ github.sha }} | ||
|
||
- run: pip install smokeshow | ||
|
||
- run: smokeshow upload htmlcov | ||
env: | ||
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage} | ||
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 80 | ||
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | ||
SMOKESHOW_GITHUB_CONTEXT: coverage | ||
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }} | ||
SMOKESHOW_AUTH_KEY: ${{ secrets.SMOKESHOW_AUTH_KEY }} | ||
|
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,57 @@ | ||
name: Create-RDS-Database | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Name-of-Your-Triggering-Workflow"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
create_database: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PostgreSQL client 16 | ||
run: | | ||
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | ||
sudo apt-get install -y wget ca-certificates | ||
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | ||
sudo apt-get update | ||
sudo apt-get install -y postgresql-client-16 | ||
- name: Create Database | ||
run: | | ||
PGPASSWORD="${{ secrets.DB_PASSWORD }}" psql -h "${{ secrets.RDS_ENDPOINT }}" -U "${{ secrets.USERNAME }}" -d "${{ secrets.DATABASE_NAME }}" -c "CREATE DATABASE <DATABASE_NAME>;" | ||
on-failure: | ||
runs-on: ubuntu-latest | ||
if: ${{ always() && (needs.create_database.result == 'failure' || needs.create_database.result == 'timed_out') }} | ||
needs: | ||
- create_database | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "Send Slack message on failure" | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_COLOR: failure | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_TEST_WORKFLOW }} | ||
SLACK_TITLE: Create Database | ||
SLACK_MESSAGE: 'Error during database creation!' | ||
|
||
on-success: | ||
runs-on: ubuntu-latest | ||
if: ${{ always() && (needs.create_database.result == 'success') }} | ||
needs: | ||
- create_database | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "Send Slack message on success" | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_COLOR: success | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_TEST_WORKFLOW }} | ||
SLACK_TITLE: Create Database | ||
SLACK_MESSAGE: 'The database has been successfully created!' |
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,53 @@ | ||
name: run_build | ||
on: [push, pull_request] | ||
env: | ||
AWS_REGION : "us-east-1" | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
|
||
run_codebuild_project: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_ORGANIZATION: ${{ github.repository_owner }} | ||
GITHUB_REPO_NAME: ${{ github.event.repository.name }} | ||
GITHUB_BRANCH_OR_TAG: ${{ github.ref_name }} | ||
GITHUB_REF: ${{ github.ref }} | ||
BUILD_NAME: ${{github.event_name}} | ||
BUILD_NUMBER: ${{github.run_id}} | ||
ECR_ADDRESS: 917902836630.dkr.ecr.us-east-1.amazonaws.com | ||
TEST_COMMAND: sleep 1 | ||
ECR_REPO: 917902836630.dkr.ecr.us-east-1.amazonaws.com/api-server | ||
OUT_DIR: ./out | ||
|
||
steps: | ||
- name: Git clone the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: configure aws credentials | ||
uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
role-to-assume: arn:aws:iam::917902836630:role/cmiml-devops-oidc-github-role | ||
role-session-name: OIDC-GHA-session | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: Get secrets by name and by ARN | ||
uses: aws-actions/aws-secretsmanager-get-secrets@v2 | ||
with: | ||
parse-json-secrets: true | ||
secret-ids: | | ||
,cmiml-devops | ||
- name: Run CodeBuild | ||
uses: aws-actions/aws-codebuild-run-build@v1 | ||
env: | ||
DOCKER_USER: ${{ env.DOCKER_USER }} | ||
DOCKER_PASSWORD: ${{ env.DOCKER_PASSWORD }} | ||
REPORT_SERVER_PUBLIC_KEY: ${{ env.REPORT_SERVER_PUBLIC_KEY }} | ||
with: | ||
project-name: mindlogger-backend-refactor-builder | ||
env-vars-for-codebuild: | | ||
GITHUB_ORGANIZATION, GITHUB_REPO_NAME, GITHUB_BRANCH_OR_TAG, GITHUB_REF, BUILD_NAME, BUILD_NUMBER, ECR_ADDRESS, TEST_COMMAND, ECR_REPO, OUT_DIR, DOCKER_USER, DOCKER_PASSWORD, REPORT_SERVER_PUBLIC_KEY |
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
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
Oops, something went wrong.