diff --git a/.github/workflows/ci_release.yml b/.github/workflows/ci_release.yml index 9bf2bc6..3a38b9f 100644 --- a/.github/workflows/ci_release.yml +++ b/.github/workflows/ci_release.yml @@ -24,11 +24,29 @@ on: - major jobs: + setup: + runs-on: ubuntu-latest + env: + # use consistent go version throughout pipeline here + GO_VERSION: "1.21" + outputs: + go-version: ${{ steps.set-vars.outputs.go-version }} + steps: + - name: Set go version + id: set-vars + run: echo "go-version=${{env.GO_VERSION}}" >> "$GITHUB_OUTPUT" + lint: + needs: [setup] uses: ./.github/workflows/lint.yml + with: + go-version: ${{ needs.setup.outputs.go-version }} test: + needs: [setup] uses: ./.github/workflows/test.yml + with: + go-version: ${{ needs.setup.outputs.go-version }} proto: uses: ./.github/workflows/proto.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 15af2f3..f2542ad 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,6 +3,11 @@ name: lint on: workflow_call: + inputs: + go-version: + description: 'Go version to use' + type: string + required: true jobs: golangci-lint: @@ -12,7 +17,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version-file: ./go.mod + go-version: ${{ inputs.go-version }} # This steps sets the GIT_DIFF environment variable to true # if files defined in PATTERS changed - uses: technote-space/get-diff-action@v6.1.2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 655450c..8f84a16 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,11 @@ name: Tests / Code Coverage on: workflow_call: + inputs: + go-version: + description: "Go version to use" + type: string + required: true jobs: go_mod_tidy_check: @@ -12,7 +17,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version-file: ./go.mod + go-version: ${{ inputs.go-version }} - run: go mod tidy - name: check for diff run: git diff --exit-code @@ -25,7 +30,7 @@ jobs: - name: set up go uses: actions/setup-go@v5 with: - go-version-file: ./go.mod + go-version: ${{ inputs.go-version }} - name: Run unit test run: make test - name: upload coverage report @@ -42,6 +47,6 @@ jobs: - name: set up go uses: actions/setup-go@v5 with: - go-version-file: ./go.mod + go-version: ${{ inputs.go-version }} - name: Integration Tests run: echo "No integration tests yet"