2023-01-20 19:57:56 +00:00
|
|
|
name: test-run-go-tests-for-path
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
name:
|
|
|
|
description: 'The name to use that will appear in the output log file artifact'
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
path:
|
|
|
|
description: 'The path to the test without the precedeing "./" or following "/..." e.g. go test -v ./$path/...'
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
# We will need to add the capacity for receiving passed secrets once we get to the tests that require API credentials
|
|
|
|
|
2023-02-09 16:17:33 +00:00
|
|
|
env:
|
|
|
|
VAULT_ACC: 1
|
|
|
|
|
2023-01-20 19:57:56 +00:00
|
|
|
jobs:
|
|
|
|
go-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-03-22 19:02:06 +00:00
|
|
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
2023-01-20 19:57:56 +00:00
|
|
|
- name: Set Up Go
|
2023-03-22 19:02:06 +00:00
|
|
|
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613
|
2023-01-20 19:57:56 +00:00
|
|
|
with:
|
2023-03-22 19:02:06 +00:00
|
|
|
go-version-file: ./.go-version
|
2023-01-20 19:57:56 +00:00
|
|
|
- run: go test -v ./${{ inputs.path }}/... 2>&1 | tee ${{ inputs.name }}.txt
|
2023-03-22 19:02:06 +00:00
|
|
|
- uses: actions/upload-artifact@b7f8abb1508181956e8e162db84b466c27e18ce
|
2023-01-20 19:57:56 +00:00
|
|
|
with:
|
|
|
|
name: ${{ inputs.name }}-output
|
|
|
|
path: ${{ inputs.name }}.txt
|
|
|
|
retention-days: 2
|