From fcef8275dad64093070b1ce901288ea9638edbc3 Mon Sep 17 00:00:00 2001 From: Piotr <17101802+thampiotr@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:38:51 +0000 Subject: [PATCH] try drone workaround --- .drone/drone.yml | 15 ++++++++++++--- .drone/pipelines/test.jsonnet | 9 ++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.drone/drone.yml b/.drone/drone.yml index 079294a17..8b7a8e454 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -162,13 +162,22 @@ platform: version: "1809" steps: - commands: + - '& "C:/Program Files/git/bin/bash.exe" -c ''echo "=== Workaround for failing clone + step ==="''' + - '& "C:/Program Files/git/bin/bash.exe" -c ''echo "DRONE_TAG=${DRONE_TAG}"''' + - '& "C:/Program Files/git/bin/bash.exe" -c ''rm -rf .git/''' + - '& "C:/Program Files/git/bin/bash.exe" -c ''git clone https://github.com/grafana/alloy.git''' + - '& "C:/Program Files/git/bin/bash.exe" -c ''cd alloy''' + - '& "C:/Program Files/git/bin/bash.exe" -c ''git checkout ${DRONE_COMMIT}''' + - '& "C:/Program Files/git/bin/bash.exe" -c ''echo "=== DONE Workaround for failing + clone step ==="''' - '& "C:/Program Files/git/bin/bash.exe" -c ''go test -tags="nodocker,nonetwork" ./...''' image: grafana/alloy-build-image:v0.1.6-windows name: Run Go tests trigger: - ref: - - refs/heads/main + event: + - pull_request type: docker --- kind: pipeline @@ -836,6 +845,6 @@ kind: secret name: updater_private_key --- kind: signature -hmac: fd0699c2276e04bf3f9957b8eca427f3812c0aaf17bb969760f66574dcaf250c +hmac: c2cbdb258086c4124f5c1b6efdf96cefb0af3aced09a08f893887973ead2b12b ... diff --git a/.drone/pipelines/test.jsonnet b/.drone/pipelines/test.jsonnet index d64e8238f..5ffdda66a 100644 --- a/.drone/pipelines/test.jsonnet +++ b/.drone/pipelines/test.jsonnet @@ -59,12 +59,19 @@ local pipelines = import '../util/pipelines.jsonnet'; pipelines.windows('Test (Windows)') { trigger: { - ref: ['refs/heads/main'], + event: ['pull_request'], }, steps: [{ name: 'Run Go tests', image: build_image.windows, commands: [ + pipelines.windows_command('echo "=== Workaround for failing clone step ==="'), + pipelines.windows_command('echo "DRONE_TAG=${DRONE_TAG}"'), + pipelines.windows_command('rm -rf .git/'), + pipelines.windows_command('git clone https://github.com/grafana/alloy.git'), + pipelines.windows_command('cd alloy'), + pipelines.windows_command('git checkout ${DRONE_COMMIT}'), + pipelines.windows_command('echo "=== DONE Workaround for failing clone step ==="'), pipelines.windows_command('go test -tags="nodocker,nonetwork" ./...'), ], }],