-
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.
feat: test and build CI/CD. Code coverage reporting
- Loading branch information
Wil Simpson
committed
Dec 6, 2024
1 parent
43a9001
commit e614714
Showing
4 changed files
with
92 additions
and
4 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,7 @@ | ||
### Proposed Changes | ||
- Change 1 | ||
- Change 2 | ||
|
||
### Related Issue(s) | ||
|
||
|
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,42 @@ | ||
name: Build Image | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Run Tests"] | ||
types: | ||
- completed | ||
|
||
env: | ||
BASE_REGISTRY: ${{ secrets.BASE_REGISTRY }} | ||
REGISTRY: '${{ secrets.BASE_REGISTRY }}/sro' | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
if: | | ||
github.event.workflow_run.conclusion == 'success' && contains(' | ||
refs/heads/main | ||
', github.ref) | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: configure aws credentials | ||
uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
role-to-assume: arn:aws:iam::779965382548:role/SRO_GitHub_Go-Backend_Production | ||
role-session-name: sroawsdeploy | ||
aws-region: us-east-1 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Build, tag, and push image to registry | ||
id: build-image | ||
run: make docker-push |
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 @@ | ||
name: Run Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- qa | ||
- dev | ||
pull_request: | ||
branches: [ '**' ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
services: | ||
dind: | ||
image: docker:27-rc-dind-rootless | ||
ports: | ||
- 2375:2375 | ||
name: Test | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.23 | ||
|
||
- name: Build | ||
run: go build -v ./... | ||
|
||
- name: Test | ||
run: | | ||
make install-tools | ||
echo "${HOME}/go/bin" >> $GITHUB_PATH | ||
make test | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_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