From b6ae598d0e0e3f028fd7d844936eea9b7b2b7eaf Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 22 Aug 2022 15:50:25 +0100 Subject: [PATCH] actions: run check for x-pack/packetbeat and packebeat (#32711) (cherry picked from commit 54b6f15ef4609ada767d7ce0c58e871205e7a2e0) # Conflicts: # packetbeat/Jenkinsfile.yml # x-pack/packetbeat/Jenkinsfile.yml --- .github/workflows/check-packetbeat.yml | 30 ++++++++++++++++++++ .github/workflows/check-xpack-packetbeat.yml | 29 +++++++++++++++++++ .github/workflows/opentelemetry.yml | 2 ++ packetbeat/Jenkinsfile.yml | 3 ++ x-pack/packetbeat/Jenkinsfile.yml | 3 ++ 5 files changed, 67 insertions(+) create mode 100644 .github/workflows/check-packetbeat.yml create mode 100644 .github/workflows/check-xpack-packetbeat.yml diff --git a/.github/workflows/check-packetbeat.yml b/.github/workflows/check-packetbeat.yml new file mode 100644 index 000000000000..937e5f7cf26a --- /dev/null +++ b/.github/workflows/check-packetbeat.yml @@ -0,0 +1,30 @@ +name: check-packetbeat + +on: + pull_request: + paths: + - '.github/workflows/check-packetbeat.yml' + - 'packetbeat/**' + - 'x-pack/packetbeat/**' + +env: + BEAT_MODULE: 'packetbeat' + +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: Install libpcap-dev + 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@latest + make -C ${{ env.BEAT_MODULE }} check update + make check-no-changes diff --git a/.github/workflows/check-xpack-packetbeat.yml b/.github/workflows/check-xpack-packetbeat.yml new file mode 100644 index 000000000000..87ab877fc0db --- /dev/null +++ b/.github/workflows/check-xpack-packetbeat.yml @@ -0,0 +1,29 @@ +name: check-x-pack-packetbeat + +on: + pull_request: + paths: + - '.github/workflows/check-xpack-packetbeat.yml' + - 'x-pack/packetbeat/**' + - 'packetbeat/**' + +env: + BEAT_MODULE: 'x-pack/packetbeat' + +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: Install libpcap-dev + run: sudo apt-get install -y libpcap-dev + - 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 d7e54e0a632b..1c1e6596fc85 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-packetbeat + - check-packetbeat - golangci-lint - auditbeat - filebeat diff --git a/packetbeat/Jenkinsfile.yml b/packetbeat/Jenkinsfile.yml index e7d0d598ec62..9b454514ee77 100644 --- a/packetbeat/Jenkinsfile.yml +++ b/packetbeat/Jenkinsfile.yml @@ -13,6 +13,7 @@ when: tags: true ## for all the tags platform: "immutable && ubuntu-18" ## default label for all the stages stages: +<<<<<<< HEAD lint: make: | make -C packetbeat check; @@ -22,6 +23,8 @@ stages: mage check; mage update; stage: lint +======= +>>>>>>> 54b6f15ef4 (actions: run check for x-pack/packetbeat and packebeat (#32711)) arm: mage: "mage build unitTest" platforms: ## override default label in this specific stage. diff --git a/x-pack/packetbeat/Jenkinsfile.yml b/x-pack/packetbeat/Jenkinsfile.yml index 77e96ef9afaa..71c3eea171e8 100644 --- a/x-pack/packetbeat/Jenkinsfile.yml +++ b/x-pack/packetbeat/Jenkinsfile.yml @@ -13,6 +13,7 @@ when: tags: true ## for all the tags platform: "immutable && ubuntu-18" ## default label for all the stages stages: +<<<<<<< HEAD lint: mage: | mage check; @@ -22,6 +23,8 @@ stages: make -C packetbeat update; make check-no-changes; stage: lint +======= +>>>>>>> 54b6f15ef4 (actions: run check for x-pack/packetbeat and packebeat (#32711)) arm: mage: "mage build unitTest" platforms: ## override default label in this specific stage.