mirror of https://github.com/fmartingr/bazaar.git
using workflow inputs/outputs
This commit is contained in:
parent
981a711d3a
commit
141721f08e
|
@ -1,14 +1,19 @@
|
|||
name: Go
|
||||
|
||||
on: workflow_call
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
go_versions:
|
||||
type: string
|
||||
description: Go versions to run workflow on
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: go-versions
|
||||
strategy:
|
||||
matrix:
|
||||
go_version: ${{ fromJSON(needs.go-versions.outputs.matrix) }}
|
||||
go_version: ${{ fromJSON(inputs.go_versions) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
name: Go
|
||||
|
||||
on: workflow_call
|
||||
on:
|
||||
workflow_call:
|
||||
outputs:
|
||||
go_versions:
|
||||
description: "The golang version matrix"
|
||||
value: ${{ jobs.go-versions.outputs.matrix }}
|
||||
|
||||
jobs:
|
||||
go-versions:
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
name: "Unit Tests"
|
||||
|
||||
on: workflow_call
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
go_versions:
|
||||
type: string
|
||||
description: Go versions to run workflow on
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: go-versions
|
||||
strategy:
|
||||
matrix:
|
||||
go_version: ${{ fromJSON(needs.go-versions.outputs.matrix) }}
|
||||
go_version: ${{ fromJSON(inputs.go_versions) }}
|
||||
name: Go ${{ matrix.go_version }} unit tests
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
|
|
@ -16,5 +16,11 @@ jobs:
|
|||
uses: ./.github/workflows/_golangci-lint.yml
|
||||
call-build:
|
||||
uses: ./.github/workflows/_build.yml
|
||||
needs: go-versions
|
||||
with:
|
||||
go_versions: ${{ needs.go-versions.outputs.go_versions }}
|
||||
call-test:
|
||||
uses: ./.github/workflows/_test.yml
|
||||
needs: go-versions
|
||||
with:
|
||||
go_versions: ${{ needs.go-versions.outputs.go_versions }}
|
||||
|
|
Loading…
Reference in New Issue