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

chore: Clean up and simplify some github actions #2880

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
109 changes: 40 additions & 69 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,38 @@ concurrency:
group: "${{ github.ref_name }}-${{ github.head_ref }}"
cancel-in-progress: true
jobs:
build_linux:
name: Build on Linux
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8
build:
strategy:
matrix:
os: [linux]
arch: [amd64, arm64, ppc64le, s390x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set ownership
# https://github.com/actions/runner/issues/2033#issuecomment-1204205989
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets promtail_journal_enabled" GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM= make alloy

build_linux_boringcrypto:
name: Build on Linux (boringcrypto)
build:
- os: linux
arch: amd64
go_tags: "builtinassets promtail_journal_enabled"
- os: linux
arch: arm64
go_tags: "builtinassets promtail_journal_enabled"
- os: linux
arch: ppc64le
go_tags: "builtinassets promtail_journal_enabled"
- os: linux
arch: s390x
go_tags: "builtinassets promtail_journal_enabled"
- os: linux
arch: amd64
go_tags: "builtinassets promtail_journal_enabled"
go_experiment: "GOEXPERIMENT=boringcrypto"
suffix: "-boringcrypto"
- os: linux
arch: arm64
go_tags: "builtinassets promtail_journal_enabled"
go_experiment: "GOEXPERIMENT=boringcrypto"
suffix: "-boringcrypto"
- os: freebsd
arch: amd64
go_tags: "builtinassets"
name: Build
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8-boringcrypto
strategy:
matrix:
os: [linux]
arch: [amd64, arm64]
container: grafana/alloy-build-image:v0.1.8${{ matrix.build.suffix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -56,26 +55,18 @@ jobs:
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets promtail_journal_enabled" GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM= GOEXPERIMENT=boringcrypto make alloy
- run: GO_TAGS="${{ matrix.build.go_tags}}" GOOS=${{ matrix.build.os }} GOARCH=${{ matrix.build.arch }} GOARM= ${{ matrix.build.go_experiment}} make alloy

build_mac_intel:
name: Build on MacOS (Intel)
runs-on: macos-14-large
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- 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
strategy:
matrix:
build:
- arch: amd64
runs_on: macos-14-large
- arch: arm64
runs_on: macos-14-xlarge
name: Build on MacOS
runs-on: ${{ matrix.build.runs_on }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -86,7 +77,7 @@ jobs:
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=darwin GOARCH=arm64 GOARM= make alloy
- run: GO_TAGS="builtinassets" GOOS=darwin GOARCH=${{ matrix.build.arch}} GOARM= make alloy

build_windows:
name: Build on Windows (AMD64)
Expand All @@ -106,23 +97,3 @@ jobs:
- run: echo "GOARCH=amd64" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: 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 ownership
# https://github.com/actions/runner/issues/2033#issuecomment-1204205989
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=freebsd GOARCH=amd64 GOARM= make alloy
Loading