Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ptodev committed Jan 21, 2025
1 parent 1136b7f commit 00c7079
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 6 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build
on:
pull_request:
# TODO: Remove workflow_dispatch later
workflow_dispatch:
jobs:
build_linux:
name: Build on Linux
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8
strategy:
matrix:
os: [linux]
arch: [amd64, arm64, ppc64le, s390x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go 1.23
uses: actions/setup-go@v5
- run: make generate-ui
- run: GO_TAGS="builtinassets promtail_journal_enabled" GOOS={{ matrix.os }} GOARCH={{ matrix.arch }} GOARM= make alloy
build_mac_intel:
name: Build on MacOS (Intel)
runs-on: macos-14-large
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
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=darwin GOARCH=amd64 GOARM= make alloy
build_mac_arm:
name: Build on MacOS (ARM)
runs-on: macos-14-xlarge
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
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=darwin GOARCH=arm64 GOARM= make alloy
build_windows:
name: Build on Windows (AMD64)
runs-on: windows-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
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=windows GOARCH=amd64 GOARM= make alloy
build_freebsd:
name: Build on FreeBSD (AMD64)
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
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=freebsd GOARCH=amd64 GOARM= make alloy
46 changes: 40 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,32 @@ on:
branches:
- main
pull_request:
# TODO: Remove workflow_dispatch later
workflow_dispatch:
jobs:
test:
name: Test
strategy:
matrix:
platform: [macos-latest-xlarge]
runs-on: ${{ matrix.platform }}
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
- 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
- run: make GO_TAGS="nodocker" test
test_macos:
name: Test MacOS
runs-on: macos-latest-xlarge
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -24,3 +43,18 @@ jobs:
cache: true
- name: Test
run: CGO_LDFLAGS="-ld_classic $CGO_LDFLAGS" make GO_TAGS="nodocker" test
test_windows:
name: Test Windows
runs-on: windows-latest
container: grafana/alloy-build-image:v0.1.8-windows
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version: "1.23"
cache: true
- name: Test
run: '& "C:/Program Files/git/bin/bash.exe" -c ''go test -tags="nodocker,nonetwork"
./...'''

0 comments on commit 00c7079

Please sign in to comment.