Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Backend CI

on:
pull_request:
paths:
- '.github/workflows/backend-ci.yml'
- '.golangci.yml'
- 'Dockerfile'
- 'cmd/**'
- 'configs/**'
- 'docs/api/**'
- 'go.mod'
- 'go.sum'
- 'internal/**'
- 'model/**'
- 'pkg/**'
- 'plugins/**'
- 'share/**'
- 'util/**'
push:
branches:
- master
- crossagent
paths:
- '.github/workflows/backend-ci.yml'
- '.golangci.yml'
- 'Dockerfile'
- 'cmd/**'
- 'configs/**'
- 'docs/api/**'
- 'go.mod'
- 'go.sum'
- 'internal/**'
- 'model/**'
- 'pkg/**'
- 'plugins/**'
- 'share/**'
- 'util/**'

concurrency:
group: backend-ci-${{ github.ref }}
cancel-in-progress: true

jobs:
go:
name: Go build and stable tests
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Build backend
run: go build -o /tmp/subscan-ci ./cmd

- name: Build backend Docker image
uses: docker/build-push-action@v6
with:
context: .
push: false
tags: subscan-essentials-ci:${{ github.sha }}

- name: Run stable backend tests
shell: bash
run: |
set -euo pipefail
# The excluded packages currently require local config/services or have pre-existing test compile/vet issues.
go list ./... \
| grep -Ev '/(internal/dao|internal/server/http|internal/service|pkg/go-web3/providers/util|plugins/evm/dao|share/redis|util/mq)$' \
| xargs go test
47 changes: 47 additions & 0 deletions .github/workflows/deploy-test-explorer-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Test Explorer API

on:
push:
branches:
- crossagent
workflow_dispatch:

concurrency:
group: test-explorer-api-deploy
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure SSH
shell: bash
env:
DEPLOY_HOST: ${{ secrets.TEST_EXPLORER_DEPLOY_HOST }}
DEPLOY_SSH_KEY: ${{ secrets.TEST_EXPLORER_DEPLOY_SSH_KEY }}
run: |
set -euo pipefail
test -n "$DEPLOY_HOST"
test -n "$DEPLOY_SSH_KEY"
install -d -m 700 ~/.ssh
printf '%s\n' "$DEPLOY_SSH_KEY" > ~/.ssh/test-explorer-deploy
chmod 600 ~/.ssh/test-explorer-deploy
ssh-keyscan -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts

- name: Deploy
shell: bash
env:
DEPLOY_HOST: ${{ secrets.TEST_EXPLORER_DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.TEST_EXPLORER_DEPLOY_USER }}
run: |
set -euo pipefail
test -n "$DEPLOY_USER"
ssh -i ~/.ssh/test-explorer-deploy \
-o BatchMode=yes \
"$DEPLOY_USER@$DEPLOY_HOST" \
'bash -s' < scripts/deploy-test-explorer-api.sh
43 changes: 0 additions & 43 deletions .github/workflows/docker.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/ui-react-deploy-docker.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/ui-react-deploy-stg.yml

This file was deleted.

1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ require (
gorm.io/datatypes v1.2.5
gorm.io/driver/mysql v1.5.6
gorm.io/driver/postgres v1.6.0
gorm.io/driver/sqlite v1.4.3
gorm.io/gorm v1.30.0
)

Expand Down
Loading
Loading