From 00c707925870fc097ae9b7127b815e83467dbb0e Mon Sep 17 00:00:00 2001 From: Paulin Todev Date: Tue, 21 Jan 2025 16:02:28 +0000 Subject: [PATCH] Testing --- .github/workflows/build.yml | 65 +++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 46 ++++++++++++++++++++++---- 2 files changed, 105 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..354a01aab4 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a952cc5a05..d4e9c2e57c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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" + ./...''' \ No newline at end of file