Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ptodev committed Feb 12, 2025
1 parent 6f7fa9e commit 456b964
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 42 deletions.
66 changes: 48 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,59 @@
name: Build
name: Build and test

on:
pull_request:

concurrency:
# Cancel any running workflow for the same branch when new commits are pushed.
# We group both by ref_name (available when CI is triggered by a push to a branch/tag)
# and head_ref (available when CI is triggered by a PR).
group: "${{ github.ref_name }}-${{ github.head_ref }}"
cancel-in-progress: true
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
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

build_linux:
name: Build on Linux
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8
# 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 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 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:
Expand All @@ -36,19 +66,19 @@ jobs:
build_linux_boringcrypto:
name: Build on Linux (boringcrypto)
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8-boringcrypto
# container: grafana/alloy-build-image:v0.1.8-boringcrypto
strategy:
matrix:
os: [linux]
arch: [amd64, arm64]
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 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:
Expand Down Expand Up @@ -113,11 +143,11 @@ jobs:
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 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:
Expand Down
27 changes: 3 additions & 24 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,8 @@ name: Test
on:
pull_request:
jobs:
lint:
name: Lint
noop:
name: Noop
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
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
- run: echo "success"

0 comments on commit 456b964

Please sign in to comment.