Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: TEST using copy to s3 composable action #312

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/reusable-go-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ on:
type: string
description: |
extra args to pass `go test`
test-coverage-upload-role:
type: string
required: false
description: |
the AWS IAM role to use to upload test results to s3 bucket
test-coverage-upload-bucket:
type: string
required: false
description: |
the AWS S3 bucket name to upload test results to.
jobs:
go-build:
if: ${{ contains(fromJSON('["workflow_call", "workflow_dispatch", "push", "pull_request"]'), github.event_name) && startsWith(github.repository, 'GeoNet/') != false }}
Expand All @@ -40,10 +50,12 @@ jobs:
setup: ${{ inputs.buildSetup }}
go-test:
if: ${{ contains(fromJSON('["workflow_call", "workflow_dispatch", "push", "pull_request"]'), github.event_name) && startsWith(github.repository, 'GeoNet/') != false }}
uses: GeoNet/Actions/.github/workflows/reusable-go-test.yml@main
uses: GeoNet/Actions/.github/workflows/reusable-go-test.yml@caS3-gotest
with:
setup: ${{ inputs.testSetup || inputs.buildSetup }}
extraArgs: ${{ inputs.goTestExtraArgs }}
aws-role-arn-to-assume: ${{ inputs.test-coverage-upload-role }}
s3-bucket: ${{ inputs.test-coverage-upload-bucket }}
go-vet:
if: ${{ contains(fromJSON('["workflow_call", "workflow_dispatch", "push", "pull_request"]'), github.event_name) && startsWith(github.repository, 'GeoNet/') != false }}
uses: GeoNet/Actions/.github/workflows/reusable-go-vet.yml@main
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/reusable-go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ on:
type: string
description: |
extra args to pass `go test`
aws-role-arn-to-assume:
type: string
required: false
description: |
role to use to upload test results to s3 bucket,
see reusable-copy-to-s3 workflow for more detail.
s3-bucket:
type: string
required: false
description: |
the AWS S3 bucket name to upload test results to.
jobs:
go-test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -39,7 +50,7 @@ jobs:
id: coverage-html
run: |
go tool cover -html=/tmp/coverage.out -o /tmp/coverage.html
- name: Upload test log
- name: Upload test log to GitHub Artifacts
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
Expand All @@ -50,3 +61,11 @@ jobs:
if-no-files-found: error
retention-days: 1
overwrite: true
- name: Upload test log to S3
uses: GeoNet/Actions/.github/actions/copy-to-s3@caS3
if: ${{ inputs.aws-role-arn-to-assume && inputs.s3-bucket }}
with:
aws-role-arn-to-assume: ${{ inputs.aws-role-arn-to-assume }}
artifact-name: test-results
artifact-path: ./coverage
s3-bucket-uri: s3://${{inputs.s3-bucket}}/test-coverage-results/${{github.repository}}/go/
Loading