-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
228 changed files
with
32,278 additions
and
316 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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: "orakl boot api test" | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- "master" | ||
paths: | ||
- "node/pkg/boot/**" | ||
- "node/migrations/boot/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
core-build: | ||
strategy: | ||
fail-fast: false | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: orakl-test | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.22.3" | ||
check-latest: true | ||
cache-dependency-path: | | ||
./node/go.sum | ||
- name: Run lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.54 | ||
working-directory: node/pkg/boot | ||
skip-pkg-cache: true | ||
skip-build-cache: true | ||
args: --timeout=10m | ||
|
||
- name: Run Vet | ||
run: | | ||
cd ./node/pkg/boot | ||
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest | ||
go vet ./... | ||
go vet -vettool=$(which shadow) ./... | ||
- name: Install golang-migrate | ||
run: | | ||
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.17.0/migrate.linux-amd64.tar.gz | tar xvz | ||
sudo mv ./migrate /usr/bin | ||
- name: Migrate up | ||
run: | | ||
cd ./node | ||
migrate -database "postgresql://postgres:postgres@localhost:5432/orakl-test?search_path=public&sslmode=disable" -verbose -path ./migrations/boot up | ||
- name: Install dependencies | ||
run: | | ||
cd ./node | ||
go mod tidy | ||
- name: Install Task | ||
uses: arduino/setup-task@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run test | ||
run: | | ||
cd ./node | ||
task local:test-boot | ||
env: | ||
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/orakl-test?search_path=public" |
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,74 @@ | ||
name: sentinel deploy to Amazon ECR | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- "sentinel/**" | ||
workflow_dispatch: | ||
|
||
env: | ||
ecr_url: public.ecr.aws/bisonai/orakl-sentinel | ||
|
||
jobs: | ||
prepare: | ||
name: Prepare Build | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
tag_date: ${{ steps.tag.outputs.date }} | ||
tag_git_hash: ${{ steps.tag.outputs.git_hash }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get time TAG | ||
id: tag | ||
run: | | ||
echo "date=$(date -u +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT | ||
echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
needs: prepare | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
outputs: | ||
tag_date: ${{ steps.tag.outputs.date }} | ||
tag_git_hash: ${{ steps.tag.outputs.git_hash }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.22.3" | ||
check-latest: true | ||
cache-dependency-path: | | ||
./sentinel/go.sum | ||
./sentinel/go.mod | ||
- name: Docker build orakl-sentinel | ||
run: SERVICE_NAME=orakl-sentinel docker compose -f docker-compose.build.yaml build | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-region: us-east-1 | ||
role-to-assume: ${{ secrets.ROLE_ARN }} | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr-public | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
with: | ||
registry-type: public | ||
|
||
- name: Publish Image to ECR(sentinel) | ||
run: | | ||
docker tag orakl-sentinel ${{ env.ecr_url }}:latest | ||
docker push ${{ env.ecr_url }}:latest | ||
docker tag ${{ env.ecr_url }}:latest ${{ env.ecr_url }}:v0.0.1.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} | ||
docker push ${{ env.ecr_url }}:v0.0.1.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} |
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,71 @@ | ||
name: "orakl sentinel test" | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- "master" | ||
paths: | ||
- "sentinel/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
core-build: | ||
strategy: | ||
fail-fast: false | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
services: | ||
redis: | ||
image: redis | ||
options: >- | ||
--health-cmd "redis-cli ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 6379:6379 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.22.3" | ||
check-latest: true | ||
cache-dependency-path: | | ||
./sentinel/go.sum | ||
- name: Run lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.54 | ||
working-directory: sentinel | ||
skip-pkg-cache: true | ||
skip-build-cache: true | ||
args: --timeout=10m | ||
|
||
- name: Run Vet | ||
run: | | ||
cd ./sentinel | ||
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest | ||
go vet ./... | ||
go vet -vettool=$(which shadow) ./... | ||
- name: Install dependencies | ||
run: | | ||
cd ./sentinel | ||
go mod tidy | ||
- name: Install Task | ||
uses: arduino/setup-task@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run test | ||
run: | | ||
cd ./sentinel | ||
task test | ||
env: | ||
CHAIN: "baobab" | ||
JSON_RPC_URL: "https://klaytn-baobab-rpc.allthatnode.com:8551" |
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
Oops, something went wrong.