diff --git a/.github/workflows/docker-crawlab.yml b/.github/workflows/docker-crawlab.yml index 823b0dc4..18235fd7 100644 --- a/.github/workflows/docker-crawlab.yml +++ b/.github/workflows/docker-crawlab.yml @@ -40,16 +40,13 @@ jobs: is_matched_frontend=0 is_matched_dockerfile=0 for file in ${{ steps.changed_files.outputs.all_changed_files }}; do - if [[ $file =~ ^${IMAGE_PATH_CRAWLAB_BACKEND}/.* ]]; then - file_backend=$file + if [[ $file =~ ^(backend|core|db|fs|grpc|vcs|trace)/.* ]]; then is_matched_backend=1 fi if [[ $file =~ ^${IMAGE_PATH_CRAWLAB_FRONTEND}/.* ]]; then - file_frontend=$file is_matched_frontend=1 fi if [[ $file == Dockerfile ]]; then - file_dockerfile=$file is_matched_dockerfile=1 fi done @@ -64,11 +61,10 @@ jobs: echo "::set-output name=is_matched_backend::$is_matched_backend" echo "::set-output name=is_matched_frontend::$is_matched_frontend" echo "::set-output name=is_matched_dockerfile::$is_matched_dockerfile" - # echo outputs - echo "is_matched_backend=$is_matched_backend, file_backend=$file_backend" - echo "is_matched_frontend=$is_matched_frontend, file_frontend=$file_frontend" - echo "is_matched_dockerfile=$is_matched_dockerfile, file_dockerfile=$file_dockerfile" + echo "is_matched_backend=$is_matched_backend" + echo "is_matched_frontend=$is_matched_frontend" + echo "is_matched_dockerfile=$is_matched_dockerfile" - id: version name: Get version @@ -101,8 +97,14 @@ jobs: go-version: '1.22' - name: Run tests run: | - cd $IMAGE_PATH_CRAWLAB_BACKEND/core - go test ./... -v + for dir in backend core db fs grpc vcs trace; do + if [ -d "$dir" ]; then + echo "Running tests in $dir" + cd $dir + go test ./... -v + cd .. + fi + done build_backend: needs: [ setup, test_backend ] diff --git a/backend/README.md b/backend/README.md index bd6eb122..a1d4b01a 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,3 +1,3 @@ # crawlab-backend -Backend (Golang) for Crawlab \ No newline at end of file +Backend (Golang) for Crawlab