Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Actions equivalents for some Drone testing builds #2527

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
# TODO: Remove this pipeline
# when its GitHub Actions equivalent is more battle-tested.
kind: pipeline
name: Lint
platform:
Expand All @@ -14,6 +17,8 @@ trigger:
- pull_request
type: docker
---
# TODO: Remove this pipeline
# when its GitHub Actions equivalent is more battle-tested.
kind: pipeline
name: Test
platform:
Expand Down Expand Up @@ -51,6 +56,8 @@ volumes:
path: /var/run/docker.sock
name: docker
---
# TODO: Remove this pipeline
# when its GitHub Actions equivalent is more battle-tested.
kind: pipeline
name: Test (Windows)
platform:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: Test (Mac)
on:
# Run tests on main just so the module and build cache can be saved and used
# in PRs. This speeds up the time it takes to test PRs dramatically.
Expand All @@ -9,7 +9,7 @@ on:
pull_request:
jobs:
test:
name: Test
name: Test (Mac)
strategy:
matrix:
platform: [macos-latest-xlarge]
Expand All @@ -23,4 +23,4 @@ jobs:
go-version: "1.23"
cache: true
- name: Test
run: CGO_LDFLAGS="-ld_classic $CGO_LDFLAGS" make GO_TAGS="nodocker" test
run: CGO_LDFLAGS="-ld_classic $CGO_LDFLAGS" make GO_TAGS="nodocker" test
31 changes: 31 additions & 0 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test
on:
pull_request:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- run: sudo apt-get update -y && sudo apt-get install -y libsystemd-dev
- run: make lint

test_linux:
name: Test Linux
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- run: make GO_TAGS="nodocker" test
26 changes: 26 additions & 0 deletions .github/workflows/test_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test (Windows)
on:
# TODO: Run the Windows tests for each PR?
# For now we don't do it just because it takes time.
push:
# TODO: Also run the tests when a Windows-specific features is changed.
# For example, the Windows Exporter for Prometheus and Event Log tailers.
branches:
- main
jobs:
test_windows:
name: Test (Windows)
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Enable caching later.
# We'll need to make sure the same cache is reused by the workflow to build Windows binaries.
cache: false
- name: Test
run: '& "C:/Program Files/git/bin/bash.exe" -c ''go test -tags="nodocker,nonetwork"
./...'''
Loading