From 6e54a4094e4173edcbc8838e779f3c88fbe8f8e9 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Sun, 20 Oct 2024 18:03:19 +0800 Subject: [PATCH] ci: added unit test in workflow --- .github/workflows/docker-crawlab.yml | 24 ++++++++++++++++++++++-- backend/conf/config.yml | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-crawlab.yml b/.github/workflows/docker-crawlab.yml index 1cccce82..823b0dc4 100644 --- a/.github/workflows/docker-crawlab.yml +++ b/.github/workflows/docker-crawlab.yml @@ -83,11 +83,31 @@ jobs: [ "$VERSION" == "main" ] && VERSION=latest echo "::set-output name=version::$VERSION" - - build_backend: + + test_backend: needs: [ setup ] if: needs.setup.outputs.is_matched_backend == '1' runs-on: ubuntu-latest + services: + mongo: + image: mongo:5 + ports: + - 27017:27017 + steps: + - uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: '1.22' + - name: Run tests + run: | + cd $IMAGE_PATH_CRAWLAB_BACKEND/core + go test ./... -v + + build_backend: + needs: [ setup, test_backend ] + if: needs.setup.outputs.is_matched_backend == '1' + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Get changed files diff --git a/backend/conf/config.yml b/backend/conf/config.yml index dbcfed87..828480b7 100755 --- a/backend/conf/config.yml +++ b/backend/conf/config.yml @@ -1,6 +1,6 @@ # Crawlab Configuration File edition: global.edition.community -version: v0.6.3 +version: v0.7.0 mongo: host: localhost