From b48a7ede413fc80718233d73a31f33a8df1ce672 Mon Sep 17 00:00:00 2001 From: nick Date: Thu, 22 Aug 2024 17:53:39 +0900 Subject: [PATCH] fix: add separate test action for raft --- .github/workflows/node.test.yaml | 1 + .github/workflows/raft.test.yaml | 65 ++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/raft.test.yaml diff --git a/.github/workflows/node.test.yaml b/.github/workflows/node.test.yaml index 2fc2c420f..8b4efd1aa 100644 --- a/.github/workflows/node.test.yaml +++ b/.github/workflows/node.test.yaml @@ -25,6 +25,7 @@ on: - "!node/cmd/delegator/**" - "!node/cmd/api/**" - "!node/cmd/sentinel/**" + - "!node/pkg/raft/**" workflow_dispatch: jobs: diff --git a/.github/workflows/raft.test.yaml b/.github/workflows/raft.test.yaml new file mode 100644 index 000000000..0ce410d66 --- /dev/null +++ b/.github/workflows/raft.test.yaml @@ -0,0 +1,65 @@ +name: "raft test" + +on: + push: + branches-ignore: + - "master" + paths: + - "node/pkg/raft/**" + workflow_dispatch: + +jobs: + core-build: + strategy: + fail-fast: false + runs-on: ubuntu-latest + timeout-minutes: 15 + + 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 + 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@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "1.22.3" + check-latest: true + cache-dependency-path: | + ./node/go.sum + + - 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-raft + env: + ENCRYPT_PASSWORD: "anything"