-
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.
chore: synced file(s) with honestbank/.github
- Loading branch information
1 parent
cfdf0f6
commit 281617c
Showing
9 changed files
with
256 additions
and
53 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 |
---|---|---|
|
@@ -17,19 +17,24 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ["1.16"] | ||
go: ["1.20"] | ||
steps: | ||
- name: Set up Golang | ||
uses: actions/setup-go@v2 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
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."[email protected]:".insteadOf "https://github.com/" | ||
|
||
- name: Setup go modules | ||
run: go clean -modcache;go mod tidy; go mod download; go mod verify; | ||
|
||
|
@@ -41,43 +46,72 @@ jobs: | |
skip-pkg-cache: true | ||
skip-build-cache: true | ||
|
||
- name: Test and generate code coverage | ||
run: go test -v -race --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 | ||
trivy_scan: | ||
name: trivy-scan | ||
|
||
integration-tests: | ||
name: integration-tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "add trivy scan" # todo | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- 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."[email protected]:".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@v2 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.16" | ||
go-version: "1.20" | ||
id: go | ||
- uses: actions/setup-node@v2 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '17' | ||
node-version: '18' | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: release | ||
uses: cycjimmy/semantic-release-action@v2 | ||
uses: cycjimmy/semantic-release-action@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
semantic_version: 18 | ||
semantic_version: 19 | ||
extra_plugins: | | ||
@semantic-release/[email protected] | ||
@semantic-release/[email protected] | ||
|
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,17 @@ | ||
# yamllint disable rule:line-length | ||
# Use template from https://github.com/honestbank/workflows/tree/main/examples/repository-workflows | ||
--- | ||
name: "repository-experiment-verification" | ||
permissions: read-all | ||
|
||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
repository-experiment-verification: | ||
name: repository-experiment-verification | ||
uses: honestbank/workflows/.github/workflows/shared-experiment-verification.yaml@main | ||
secrets: inherit | ||
with: | ||
experiment_required: false |
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,17 +1,21 @@ | ||
name: "Semantic Pull Request" | ||
# 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 | ||
|
||
on: | ||
# yamllint disable rule:line-length | ||
# Use template from https://github.com/honestbank/workflows/tree/main/examples/repository-workflows | ||
--- | ||
name: "repository-semantic-pr" | ||
permissions: read-all | ||
|
||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
repository-semantic-pr: | ||
name: repository-semantic-pr | ||
uses: honestbank/workflows/.github/workflows/shared-semantic-pr.yaml@main | ||
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
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# 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 | ||
|
||
version: "3.0" | ||
services: | ||
db: | ||
image: mysql:8 | ||
ports: | ||
- "3306:3306" | ||
environment: | ||
- MYSQL_USER=dbuser | ||
- MYSQL_PASSWORD=dbpass | ||
- MYSQL_DATABASE=my_db | ||
- MYSQL_RANDOM_ROOT_PASSWORD=true | ||
zookeeper: | ||
image: confluentinc/cp-zookeeper:7.3.2 | ||
hostname: zookeeper | ||
container_name: zookeeper | ||
restart: "always" | ||
ports: | ||
- "2181:2181" | ||
environment: | ||
ZOOKEEPER_CLIENT_PORT: 2181 | ||
ZOOKEEPER_TICK_TIME: 2000 | ||
kafka: | ||
image: confluentinc/cp-kafka:7.3.2 | ||
hostname: kafka | ||
container_name: kafka | ||
restart: "always" | ||
ports: | ||
- "9092:9092" | ||
environment: | ||
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT | ||
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL | ||
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" | ||
KAFKA_SCHEMA_REGISTRY_URL: "http://schemaregistry:8082" | ||
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO" | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 | ||
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 | ||
KAFKA_JMX_PORT: 9999 | ||
KAFKA_JMX_HOSTNAME: ${DOCKER_HOST_IP:-127.0.0.1} | ||
KAFKA_NUM_PARTITIONS: 1 | ||
depends_on: | ||
- zookeeper | ||
schemaregistry: | ||
image: confluentinc/cp-schema-registry:7.3.2 | ||
restart: always | ||
depends_on: | ||
- kafka | ||
environment: | ||
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: "kafka:19092" | ||
SCHEMA_REGISTRY_HOST_NAME: schemaregistry | ||
SCHEMA_REGISTRY_LISTENERS: "http://0.0.0.0:8082" | ||
ports: | ||
- 8082:8082 | ||
gcs: | ||
image: oittaa/gcp-storage-emulator:latest | ||
ports: | ||
- "8080:8080" |
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,63 @@ | ||
# 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 | ||
|
||
version: "3.0" | ||
services: | ||
db: | ||
image: mysql:8 | ||
ports: | ||
- "3306:3306" | ||
environment: | ||
- MYSQL_USER=dbuser | ||
- MYSQL_PASSWORD=dbpass | ||
- MYSQL_DATABASE=my_db | ||
- MYSQL_RANDOM_ROOT_PASSWORD=true | ||
zookeeper: | ||
image: confluentinc/cp-zookeeper:7.3.2 | ||
hostname: zookeeper | ||
container_name: zookeeper | ||
restart: "always" | ||
ports: | ||
- "2181:2181" | ||
environment: | ||
ZOOKEEPER_CLIENT_PORT: 2181 | ||
ZOOKEEPER_TICK_TIME: 2000 | ||
kafka: | ||
image: confluentinc/cp-kafka:7.3.2 | ||
hostname: kafka | ||
container_name: kafka | ||
restart: "always" | ||
ports: | ||
- "9092:9092" | ||
environment: | ||
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT | ||
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL | ||
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" | ||
KAFKA_SCHEMA_REGISTRY_URL: "http://schemaregistry:8082" | ||
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO" | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 | ||
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 | ||
KAFKA_JMX_PORT: 9999 | ||
KAFKA_JMX_HOSTNAME: ${DOCKER_HOST_IP:-127.0.0.1} | ||
KAFKA_NUM_PARTITIONS: 1 | ||
depends_on: | ||
- zookeeper | ||
schemaregistry: | ||
image: confluentinc/cp-schema-registry:7.3.2 | ||
restart: always | ||
depends_on: | ||
- kafka | ||
environment: | ||
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: "kafka:19092" | ||
SCHEMA_REGISTRY_HOST_NAME: schemaregistry | ||
SCHEMA_REGISTRY_LISTENERS: "http://0.0.0.0:8082" | ||
ports: | ||
- 8082:8082 | ||
gcs: | ||
image: oittaa/gcp-storage-emulator:latest | ||
ports: | ||
- "8080:8080" |
Oops, something went wrong.