-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: synced file(s) with honestbank/.github
- Loading branch information
1 parent
a982e9c
commit ac54c5b
Showing
6 changed files
with
65 additions
and
117 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
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 |
---|---|---|
@@ -1,118 +1,24 @@ | ||
# This is managed workflow, do not change this file in downstream repo | ||
# DO NOT CHANGE. This file is being managed from a central repository | ||
# To know more simply visit https://github.com/honestbank/.github/blob/main/docs/about.md | ||
|
||
name: go-tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
GOPRIVATE: github.com/honestbank | ||
branches: [main, master] | ||
|
||
jobs: | ||
build: | ||
name: go-tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ["1.20"] | ||
steps: | ||
- name: Set up Golang | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure ssh-key for private modules | ||
env: | ||
SSH_KEY: ${{ secrets.ENGINEERING_SSH_KEY }} | ||
run: mkdir -p ~/.ssh; echo "$SSH_KEY" > ~/.ssh/id_rsa; chmod 600 ~/.ssh/id_rsa; git config --global url."git@github.com:".insteadOf "https://github.com/" | ||
|
||
- name: Setup go modules | ||
run: go clean -modcache;go mod tidy; go mod download; go mod verify; | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: latest | ||
args: --timeout=5m --modules-download-mode=readonly | ||
skip-pkg-cache: true | ||
skip-build-cache: true | ||
|
||
- name: sonarcloud-scan | ||
uses: sonarsource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
continue-on-error: true | ||
|
||
integration-tests: | ||
name: integration-tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
load-secrets: | ||
uses: "./.github/workflows/secrets-loader.yaml" | ||
secrets: inherit | ||
|
||
- name: Set up Golang | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20" | ||
id: go | ||
|
||
- name: Start docker containers for integration tests | ||
run: docker-compose -f docker-compose.integration.yaml up -d | ||
|
||
- name: Configure ssh-key for private modules | ||
env: | ||
SSH_KEY: ${{ secrets.ENGINEERING_SSH_KEY }} | ||
run: mkdir -p ~/.ssh; echo "$SSH_KEY" > ~/.ssh/id_rsa; chmod 600 ~/.ssh/id_rsa; git config --global url."git@github.com:".insteadOf "https://github.com/" | ||
|
||
- name: Setup go modules | ||
run: go mod tidy | ||
|
||
- name: Test and generate code coverage | ||
run: go test -tags=integration_test -coverprofile=coverage.txt -covermode=atomic ./... | ||
|
||
- name: sonarcloud-scan | ||
uses: sonarsource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
continue-on-error: true | ||
|
||
release: | ||
name: semantic-release | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- name: Set up Golang | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20" | ||
id: go | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: release | ||
uses: cycjimmy/semantic-release-action@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
semantic_version: 19 | ||
extra_plugins: | | ||
@semantic-release/git@10.0.1 | ||
@semantic-release/exec@6.0.2 | ||
@semantic-release/changelog@6.0.1 | ||
go-tests: | ||
name: go-tests | ||
needs: | ||
- load-secrets | ||
uses: honestbank/workflows/.github/workflows/shared-build-go-sdk-template.yaml@main | ||
secrets: inherit | ||
with: | ||
encrypted_secrets : ${{ needs.load-secrets.outputs.encrypted_secrets }} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: go-version-check | ||
permissions: | ||
contents: read | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
jobs: | ||
repository-go-version-check: | ||
name: repository-go-version-check | ||
uses: honestbank/workflows/.github/workflows/shared-go-version-check.yaml@main | ||
with: | ||
ignore_version_check: false | ||
secrets: inherit |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# DO NOT CHANGE. This file is being managed from a central repository | ||
# To know more simply visit https://github.com/honestbank/.github/blob/main/docs/about.md | ||
|
||
name: repository-pre-commit-checks | ||
|
||
on: | ||
pull_request: | ||
branches: [main, master] | ||
|
||
jobs: | ||
load-secrets: | ||
uses: "./.github/workflows/secrets-loader.yaml" | ||
secrets: inherit | ||
repository-pre-commit-checks: | ||
name: repository-pre-commit-checks | ||
needs: | ||
- load-secrets | ||
uses: honestbank/workflows/.github/workflows/shared-pre-commit-checks-go.yaml@main | ||
secrets: inherit | ||
with: | ||
encrypted_secrets : ${{ needs.load-secrets.outputs.encrypted_secrets }} |
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