From f52d7d1407ddc7f5e5139c9662f45a2ada85820d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 22 Aug 2022 17:22:52 +0100 Subject: [PATCH 1/5] action: checks for x-pack/libbeat and libbeat --- .github/workflows/check-libbeat.yml | 28 +++++++++++++++++++++++ .github/workflows/check-xpack-libbeat.yml | 27 ++++++++++++++++++++++ .github/workflows/opentelemetry.yml | 2 ++ libbeat/Jenkinsfile.yml | 8 ------- x-pack/libbeat/Jenkinsfile.yml | 6 ----- 5 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/check-libbeat.yml create mode 100644 .github/workflows/check-xpack-libbeat.yml diff --git a/.github/workflows/check-libbeat.yml b/.github/workflows/check-libbeat.yml new file mode 100644 index 000000000000..9b660fbe52fe --- /dev/null +++ b/.github/workflows/check-libbeat.yml @@ -0,0 +1,28 @@ +name: check-libbeat + +on: + pull_request: + paths: + - '.github/workflows/check-packetbeat.yml' + - 'libbeat/**' + - 'x-pack/libbeat/**' + +env: + BEAT_MODULE: 'libbeat' + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Fetch Go version from .go-version + run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV + - uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + - name: Run check/update + run: | + export PATH=$PATH:$(go env GOPATH)/bin + go install github.com/magefile/mage@latest + make -C ${{ env.BEAT_MODULE }} check update + make check-no-changes diff --git a/.github/workflows/check-xpack-libbeat.yml b/.github/workflows/check-xpack-libbeat.yml new file mode 100644 index 000000000000..6808be644409 --- /dev/null +++ b/.github/workflows/check-xpack-libbeat.yml @@ -0,0 +1,27 @@ +name: check-x-pack-libbeat + +on: + pull_request: + paths: + - '.github/workflows/check-xpack-libbeat.yml' + - 'x-pack/libbeat/**' + - 'libbeat/**' + +env: + BEAT_MODULE: 'x-pack/libbeat' + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Fetch Go version from .go-version + run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV + - uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + - name: Run check/update + uses: magefile/mage-action@v2 + with: + args: check update + workdir: "${{ env.BEAT_MODULE }}" diff --git a/.github/workflows/opentelemetry.yml b/.github/workflows/opentelemetry.yml index 5e48b49ff8b1..678fd932c66e 100644 --- a/.github/workflows/opentelemetry.yml +++ b/.github/workflows/opentelemetry.yml @@ -3,6 +3,8 @@ name: OpenTelemetry Export Trace on: workflow_run: workflows: + - check-x-pack-libbeat + - check-libbeat - check-x-pack-packetbeat - check-packetbeat - golangci-lint diff --git a/libbeat/Jenkinsfile.yml b/libbeat/Jenkinsfile.yml index 6219b7bdd09c..2bf7e681ae4e 100644 --- a/libbeat/Jenkinsfile.yml +++ b/libbeat/Jenkinsfile.yml @@ -12,14 +12,6 @@ when: tags: true ## for all the tags platform: "immutable && ubuntu-18" ## default label for all the stages stages: - checks: - make: | - make -C libbeat check; - make -C libbeat update; - make -C x-pack/libbeat check; - make -C x-pack/libbeat update; - make check-no-changes; - stage: checks arm: mage: "mage build unitTest" platforms: ## override default label in this specific stage. diff --git a/x-pack/libbeat/Jenkinsfile.yml b/x-pack/libbeat/Jenkinsfile.yml index 34ac4a184692..fb00273853a3 100644 --- a/x-pack/libbeat/Jenkinsfile.yml +++ b/x-pack/libbeat/Jenkinsfile.yml @@ -13,12 +13,6 @@ when: tags: true ## for all the tags platform: "immutable && ubuntu-18" ## default label for all the stages stages: - checks: - make: | - make -C x-pack/libbeat check; - make -C x-pack/libbeat update; - make check-no-changes; - stage: checks arm: mage: "mage build unitTest" platforms: ## override default label in this specific stage. From d804e4cb61f01a94275e05cddda2c8ee1a1dc5fb Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 22 Aug 2022 17:29:11 +0100 Subject: [PATCH 2/5] use make instead --- .github/workflows/check-xpack-libbeat.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-xpack-libbeat.yml b/.github/workflows/check-xpack-libbeat.yml index 6808be644409..e5630282c63b 100644 --- a/.github/workflows/check-xpack-libbeat.yml +++ b/.github/workflows/check-xpack-libbeat.yml @@ -21,7 +21,8 @@ jobs: with: go-version: ${{ env.GO_VERSION }} - name: Run check/update - uses: magefile/mage-action@v2 - with: - args: check update - workdir: "${{ env.BEAT_MODULE }}" + run: | + export PATH=$PATH:$(go env GOPATH)/bin + go install github.com/magefile/mage@latest + make -C ${{ env.BEAT_MODULE }} check update + make check-no-changes From c0d11607a1547f2c9d6785236f7b74dfd804b2b1 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 22 Aug 2022 17:29:43 +0100 Subject: [PATCH 3/5] dependency libpcap-dev --- .github/workflows/check-libbeat.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check-libbeat.yml b/.github/workflows/check-libbeat.yml index 9b660fbe52fe..9f6636d0161b 100644 --- a/.github/workflows/check-libbeat.yml +++ b/.github/workflows/check-libbeat.yml @@ -20,6 +20,8 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ env.GO_VERSION }} + - name: Install libpcap-dev + run: sudo apt-get install -y libpcap-dev - name: Run check/update run: | export PATH=$PATH:$(go env GOPATH)/bin From 42cb6aaeaed2be5106d880504dcb73fab9b4e934 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 23 Aug 2022 10:19:43 +0100 Subject: [PATCH 4/5] Apply suggestions from code review --- .github/workflows/check-libbeat.yml | 6 +++--- .github/workflows/check-xpack-libbeat.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-libbeat.yml b/.github/workflows/check-libbeat.yml index 9f6636d0161b..db00a694168f 100644 --- a/.github/workflows/check-libbeat.yml +++ b/.github/workflows/check-libbeat.yml @@ -14,10 +14,10 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Fetch Go version from .go-version run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} - name: Install libpcap-dev @@ -25,6 +25,6 @@ jobs: - name: Run check/update run: | export PATH=$PATH:$(go env GOPATH)/bin - go install github.com/magefile/mage@latest + go install github.com/magefile/mage make -C ${{ env.BEAT_MODULE }} check update make check-no-changes diff --git a/.github/workflows/check-xpack-libbeat.yml b/.github/workflows/check-xpack-libbeat.yml index e5630282c63b..5e85e950eef2 100644 --- a/.github/workflows/check-xpack-libbeat.yml +++ b/.github/workflows/check-xpack-libbeat.yml @@ -14,15 +14,15 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Fetch Go version from .go-version run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} - name: Run check/update run: | export PATH=$PATH:$(go env GOPATH)/bin - go install github.com/magefile/mage@latest + go install github.com/magefile/mage make -C ${{ env.BEAT_MODULE }} check update make check-no-changes From cfc97eca501ee42d5f6974ebf1e5e50758c30228 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 23 Aug 2022 14:45:41 +0100 Subject: [PATCH 5/5] Apply suggestions from code review --- .github/workflows/check-libbeat.yml | 1 - .github/workflows/check-xpack-libbeat.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/check-libbeat.yml b/.github/workflows/check-libbeat.yml index db00a694168f..ec76fbefbc90 100644 --- a/.github/workflows/check-libbeat.yml +++ b/.github/workflows/check-libbeat.yml @@ -24,7 +24,6 @@ jobs: run: sudo apt-get install -y libpcap-dev - name: Run check/update run: | - export PATH=$PATH:$(go env GOPATH)/bin go install github.com/magefile/mage make -C ${{ env.BEAT_MODULE }} check update make check-no-changes diff --git a/.github/workflows/check-xpack-libbeat.yml b/.github/workflows/check-xpack-libbeat.yml index 5e85e950eef2..4428b8ad9008 100644 --- a/.github/workflows/check-xpack-libbeat.yml +++ b/.github/workflows/check-xpack-libbeat.yml @@ -22,7 +22,6 @@ jobs: go-version: ${{ env.GO_VERSION }} - name: Run check/update run: | - export PATH=$PATH:$(go env GOPATH)/bin go install github.com/magefile/mage make -C ${{ env.BEAT_MODULE }} check update make check-no-changes