-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add initial ci pipleline to run on every commit, pr and merge to main
Showing
13 changed files
with
170 additions
and
15 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
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,7 @@ | ||
name: Continuous Integration (Commit) | ||
on: | ||
push: | ||
# run per commit ci checks against this commit | ||
jobs: | ||
lint: | ||
uses: ./.github/workflows/ci-lint.yml |
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,31 @@ | ||
name: Continuous Integration (Default Checks) | ||
|
||
on: | ||
workflow_call: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo from current commit | ||
uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.20' | ||
check-latest: true | ||
cache: true | ||
- name: build application binary | ||
run: make install | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo from current commit | ||
uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.20' | ||
check-latest: true | ||
cache: true | ||
- name: run unit tests | ||
run: make unit-test |
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,39 @@ | ||
name: Continuous Integration (E2E Testing Checks) | ||
|
||
on: | ||
workflow_call: | ||
jobs: | ||
e2e-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo from current commit | ||
uses: actions/checkout@v3 | ||
- name: set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.20" | ||
check-latest: true | ||
cache: true | ||
- name: pull pre-built images | ||
run: sudo docker compose -f ci.docker-compose.yml pull | ||
# In this step, this action saves a list of existing images, | ||
# the cache is created without them in the post run. | ||
# It also restores the cache if it exists. | ||
- name: cache docker images | ||
uses: satackey/[email protected] | ||
# Ignore the failure of a step and avoid terminating the job. | ||
continue-on-error: true | ||
- name: build and start proxy service and it's dependencies | ||
run: sudo docker compose -f ci.docker-compose.yml up -d | ||
- name: wait for proxy service to be running | ||
run: bash ${GITHUB_WORKSPACE}/scripts/wait-for-proxy-service-running.sh | ||
env: | ||
PROXY_CONTAINER_PORT: 7777 | ||
- name: run e2e tests | ||
run: make e2e-test | ||
- name: print proxy service logs | ||
run: sudo docker compose -f ci.docker-compose.yml logs proxy | ||
# because we especially want the logs if the test(s) fail 😅 | ||
if: always() | ||
# Finally, "Post Run jpribyl/[email protected]", | ||
# which is the process of saving the cache, will be executed. |
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,14 @@ | ||
name: Lint Checks | ||
on: | ||
workflow_call: | ||
# run per commit lint checks against this commit | ||
jobs: | ||
golangci-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: golangci-lint | ||
uses: reviewdog/action-golangci-lint@v2 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-review |
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,13 @@ | ||
name: Continuous Integration (Kava Proxy Service Main) | ||
on: | ||
push: | ||
# run CI on any push to the main branch | ||
branches: | ||
- main | ||
jobs: | ||
# run per commit ci checks against master branch | ||
lint-checks: | ||
uses: ./.github/workflows/ci-lint.yml | ||
# run default ci checks against master branch | ||
default-checks: | ||
uses: ./.github/workflows/ci-default.yml |
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,13 @@ | ||
name: Continuous Integration (PR) | ||
on: | ||
pull_request: | ||
# run CI on pull requests to main or a release branch | ||
branches: | ||
- main | ||
- 'releases/**' | ||
# run default ci checks against current PR | ||
jobs: | ||
# default: | ||
# uses: ./.github/workflows/ci-default.yml | ||
e2e-tests: | ||
uses: ./.github/workflows/ci-e2e-tests.yml |
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,34 @@ | ||
--- | ||
services: | ||
# run postgres for proxy service to store observability metrics | ||
postgres: | ||
image: postgres:15 | ||
env_file: .env | ||
ports: | ||
- "${POSTGRES_HOST_PORT}:${POSTGRES_CONTAINER_PORT}" | ||
expose: | ||
- "${POSTGRES_CONTAINER_PORT}" | ||
# run redis for proxy service to cache responses | ||
redis: | ||
image: 'bitnami/redis:latest' | ||
env_file: .env | ||
ports: | ||
- "${REDIS_HOST_PORT}:${REDIS_CONTAINER_PORT}" | ||
expose: | ||
- "${REDIS_CONTAINER_PORT}" | ||
# run proxy service to observe, route, and scale requests to kava api endpoints | ||
proxy: | ||
build: | ||
dockerfile: local.Dockerfile | ||
env_file: .env | ||
environment: | ||
# use public testnet as backend origin server to avoid having | ||
# to self-host a beefy Github Action runner | ||
# to build and run a kava node each execution | ||
PROXY_BACKEND_HOST_URL_MAP: localhost:7777>https://evmrpc.internal.testnet.proxy.kava.io,localhost:7778>https://evmrpcdata.internal.testnet.proxy.kava.io | ||
ports: | ||
- "${PROXY_HOST_PORT}:${PROXY_CONTAINER_PORT}" | ||
- "${PROXY_CONTAINER_EVM_RPC_DATA_PORT}:${PROXY_CONTAINER_PORT}" | ||
- "${PROXY_HOST_DEBUG_PORT}:${PROXY_CONTAINER_DEBUG_PORT}" | ||
cap_add: | ||
- SYS_PTRACE # Allows for attaching debugger to process in this container |
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