Update update-dependencies.yml

This commit is contained in:
civisrom 2025-02-09 23:26:41 +03:00 committed by GitHub
parent b32e178735
commit cdbddb4882
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,7 +30,6 @@ jobs:
run: | run: |
go clean -modcache go clean -modcache
go clean -cache go clean -cache
go clean -testcache
- name: Update dependencies - name: Update dependencies
id: update id: update
@ -38,12 +37,9 @@ jobs:
set -e # Прерываем выполнение при ошибках set -e # Прерываем выполнение при ошибках
echo "Updating Go dependencies..." echo "Updating Go dependencies..."
touch update_errors.log # Выводим текущие версии
echo "Current versions:"
{ go list -m all
# Сохраняем текущие версии
echo "Current versions:" > dependency_changes.txt
go list -m all >> dependency_changes.txt
# Обновляем только объявленные зависимости # Обновляем только объявленные зависимости
go get -u ./... go get -u ./...
@ -52,16 +48,11 @@ jobs:
go mod tidy go mod tidy
go mod verify go mod verify
# Записываем обновленные версии # Выводим обновленные версии
echo -e "\nUpdated versions:" >> dependency_changes.txt echo -e "\nUpdated versions:"
go list -m all >> dependency_changes.txt go list -m all
} 2>update_errors.log || {
echo "::error::Dependency update failed"
cat update_errors.log
exit 1
}
- name: Validate build & run tests - name: Validate build
run: | run: |
set -e set -e
@ -73,14 +64,6 @@ jobs:
echo "Running go vet..." echo "Running go vet..."
go vet ./... go vet ./...
# Запускаем тесты, если они есть
if go list ./... | grep -qv vendor; then
echo "Running tests..."
go test ./... -race
else
echo "No test files found, skipping tests."
fi
- name: Check for changes - name: Check for changes
id: check id: check
run: | run: |
@ -100,8 +83,3 @@ jobs:
git add go.mod go.sum git add go.mod go.sum
git commit -m "chore(deps): update Go dependencies" git commit -m "chore(deps): update Go dependencies"
git push origin ${{ github.ref }} git push origin ${{ github.ref }}
- name: Cleanup
if: always()
run: |
rm -f update_errors.log dependency_changes.txt