Skip to content

Commit

Permalink
Add GitHub Actions equivalents for some Drone builds. (#2527)
Browse files Browse the repository at this point in the history
The Drone builds will be deleted once the GitHub Actions are more battle tested.
  • Loading branch information
ptodev authored Jan 31, 2025
1 parent 74ff1da commit db30a7d
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml → .github/workflows/test_mac.yml
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"
./...'''

0 comments on commit db30a7d

Please sign in to comment.