Skip to content

Commit

Permalink
ci: migrate windows promtail tests to github action (#12490)
Browse files Browse the repository at this point in the history
Signed-off-by: Callum Styan <[email protected]>
  • Loading branch information
cstyan authored Apr 5, 2024
1 parent 23b5d03 commit 45ca2fa
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 51 deletions.
25 changes: 0 additions & 25 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,6 @@ local arch_image(arch, tags='') = {
}],
};

local promtail_win() = pipeline('promtail-windows') {
platform: {
os: 'windows',
arch: 'amd64',
version: '1809',
},
steps: [
{
name: 'identify-runner',
image: 'golang:1.21.3-windowsservercore-1809',
commands: [
'Write-Output $env:DRONE_RUNNER_NAME',
],
},
{
name: 'test',
image: 'golang:1.21.3-windowsservercore-1809',
commands: [
'go test .\\clients\\pkg\\promtail\\targets\\windows\\... -v',
],
},
],
};

local querytee() = pipeline('querytee-amd64') + arch_image('amd64', 'main') {
steps+: [
// publish for tag or main
Expand Down Expand Up @@ -654,7 +630,6 @@ local build_image_tag = '0.33.1-golangci.1.51.2';
},
],
},
promtail_win(),
logql_analyzer(),
pipeline('docker-driver') {
trigger+: onTagOrMain,
Expand Down
24 changes: 1 addition & 23 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1070,28 +1070,6 @@ trigger:
- refs/tags/v*
---
kind: pipeline
name: promtail-windows
platform:
arch: amd64
os: windows
version: "1809"
steps:
- commands:
- Write-Output $env:DRONE_RUNNER_NAME
image: golang:1.21.3-windowsservercore-1809
name: identify-runner
- commands:
- go test .\clients\pkg\promtail\targets\windows\... -v
image: golang:1.21.3-windowsservercore-1809
name: test
trigger:
ref:
- refs/heads/main
- refs/heads/k???
- refs/tags/v*
- refs/pull/*/head
---
kind: pipeline
name: logql-analyzer
platform:
arch: amd64
Expand Down Expand Up @@ -1362,6 +1340,6 @@ kind: secret
name: gpg_private_key
---
kind: signature
hmac: 560c2d3971da2fd49144c9ff81048607e4caaa11efab55be5e112c971239d1b1
hmac: ef80f57ffff4f20ac7e12ef7eec7d8cee1d0b217a8ec5a93fe8d459f0967e155

...
22 changes: 22 additions & 0 deletions .github/workflows/promtail-windows-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Promtail Windows Test
on:
pull_request:
tags: ['v[0-9].[0-9]+.[0-9]+']
branches: [main, k*]
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
go-version: [ '1.21.9', '1.22.2' ]
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
# You can test your matrix by printing the current Go version
- name: Display Go version
run: go version
- name: Run promtail tests
run: go test .\clients\pkg\promtail\targets\windows\... -v
6 changes: 3 additions & 3 deletions .github/workflows/verify-drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ jobs:
continue-on-error: true
id: changed-files
run: |
echo "changed_files=$(git diff --name-only .drone/ | xargs)" >> $GITHUB_OUTPUT
git diff | grep +hmac
echo "changed_files=$(git diff --name-only main -- .drone/ | xargs)" >> $GITHUB_OUTPUT
git diff main .drone/ | grep "+hmac "
echo "sha_updated=$?" >> $GITHUB_OUTPUT
- name: Check that drone was updated properly
if: always()
run: |
jsonnetChanged=false
yamlChanged=false
echo "sha updated? ${{ steps.changed-files.outputs.sha_updated }}"
# check whether the drone jsonnet and yaml files were updated
for file in ${{ steps.changed-files.outputs.changed_files }}; do
echo "$file was changed"
if [ "$file" == ".drone/drone.jsonnet" ]; then
echo "$file was changed"
jsonnetChanged=true
Expand Down

0 comments on commit 45ca2fa

Please sign in to comment.