ci: modified workflow

This commit is contained in:
Marvin Zhang
2024-10-20 18:13:05 +08:00
parent 76793c0c47
commit c89bbd1f35
2 changed files with 13 additions and 11 deletions

View File

@@ -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 ]

View File

@@ -1,3 +1,3 @@
# crawlab-backend
Backend (Golang) for Crawlab
Backend (Golang) for Crawlab