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-07-05 21:19:49 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-01-20 19:57:56 +00:00
|
|
|
- name: Set Up Go
|
2023-07-05 21:19:49 +00:00
|
|
|
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
|
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-05-22 17:18:06 +00:00
|
|
|
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2023-01-20 19:57:56 +00:00
|
|
|
with:
|
|
|
|
name: ${{ inputs.name }}-output
|
|
|
|
path: ${{ inputs.name }}.txt
|
|
|
|
retention-days: 2
|