-
Notifications
You must be signed in to change notification settings - Fork 968
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore/ramin/jwt-newline
- Loading branch information
Showing
4 changed files
with
75 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ on: | |
- "v*" | ||
pull_request: | ||
workflow_dispatch: | ||
# Inputs the workflow accepts. | ||
inputs: | ||
version: | ||
# Friendly description to be shown in the UI instead of 'name' | ||
|
@@ -23,6 +22,27 @@ on: | |
- major | ||
|
||
jobs: | ||
# set up go version for use through pipelines, setting | ||
# variable one time and setting outputs to access passing it | ||
# to other jobs | ||
setup: | ||
runs-on: ubuntu-latest | ||
env: | ||
# upgrade go version throughout pipeline here | ||
GO_VERSION: "1.21" | ||
outputs: | ||
go-version: ${{ steps.set-vars.outputs.go-version }} | ||
branch: ${{ steps.trim_ref.outputs.branch }} | ||
steps: | ||
- name: Set go version | ||
id: set-vars | ||
run: echo "go-version=${{env.GO_VERSION}}" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Trim branch name | ||
id: trim_ref | ||
run: | | ||
echo "branch=$(${${{ github.ref }}:11})" >> $GITHUB_OUTPUT | ||
# Dockerfile Linting | ||
hadolint: | ||
uses: celestiaorg/.github/.github/workflows/[email protected] # yamllint disable-line rule:line-length | ||
|
@@ -48,7 +68,10 @@ jobs: | |
markdownlint --config .markdownlint.yaml '**/*.md' | ||
go-ci: | ||
needs: setup | ||
uses: ./.github/workflows/go-ci.yml | ||
with: | ||
go-version: ${{ needs.setup.outputs.go-version }} | ||
|
||
# If this was a workflow dispatch event, we need to generate and push a tag | ||
# for goreleaser to grab | ||
|
@@ -58,6 +81,7 @@ jobs: | |
permissions: "write-all" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Bump version and push tag | ||
# Placing the if condition here is a workaround for needing to block | ||
# on this step during workflow dispatch events but the step not | ||
|
@@ -66,12 +90,10 @@ jobs: | |
# in goreleaser not running either. | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
uses: mathieudutour/[email protected] | ||
|
||
- name: Version Release | ||
uses: celestiaorg/.github/.github/actions/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
default_bump: ${{ inputs.version }} | ||
release_branches: ${{ needs.setup.outputs.branch }} | ||
|
||
# Generate the release with goreleaser to include pre-built binaries | ||
goreleaser: | ||
|
@@ -83,16 +105,20 @@ jobs: | |
permissions: "write-all" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: git fetch --force --tags | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21 | ||
go-version: ${{ needs.setup.outputs.go-version }} | ||
|
||
- name: Import GPG key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v4 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
# Generate the binaries and release | ||
- uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,11 @@ name: Go CI | |
|
||
on: | ||
workflow_call: | ||
|
||
env: | ||
GO_VERSION: '1.21' | ||
inputs: | ||
go-version: | ||
description: 'Go version' | ||
required: true | ||
type: string | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
|
@@ -20,7 +22,7 @@ jobs: | |
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
go-version: ${{ inputs.go-version }} | ||
|
||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
|
@@ -38,7 +40,7 @@ jobs: | |
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
go-version: ${{ inputs.go-version }} | ||
|
||
- run: go mod tidy | ||
|
||
|
@@ -61,7 +63,7 @@ jobs: | |
- name: set up go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
go-version: ${{ inputs.go-version }} | ||
|
||
- name: run unit tests | ||
run: make test-unit | ||
|
@@ -85,10 +87,11 @@ jobs: | |
- name: set up go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
go-version: ${{ inputs.go-version }} | ||
|
||
- name: execute test run | ||
run: make test-unit-race | ||
continue-on-error: true | ||
|
||
integration_test: | ||
needs: [lint, go_mod_tidy_check] | ||
|
@@ -101,10 +104,12 @@ jobs: | |
- name: set up go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
go-version: ${{ inputs.go-version }} | ||
|
||
- name: Swamp Tests | ||
run: make test-swamp | ||
continue-on-error: true | ||
|
||
- name: Swamp Tests with Race Detector | ||
run: make test-swamp-race | ||
continue-on-error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters