From d998bc13c733e4ccbae3e20e7cc123f230980f85 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 25 Aug 2022 09:38:25 +0100 Subject: [PATCH] action: checks for filebeat and x-pack/filebeat (#32746) --- .github/workflows/check-filebeat.yml | 29 ++++++++++++++++++++++ .github/workflows/check-xpack-filebeat.yml | 29 ++++++++++++++++++++++ .github/workflows/opentelemetry.yml | 2 ++ filebeat/Jenkinsfile.yml | 8 ------ x-pack/filebeat/Jenkinsfile.yml | 8 ------ 5 files changed, 60 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/check-filebeat.yml create mode 100644 .github/workflows/check-xpack-filebeat.yml diff --git a/.github/workflows/check-filebeat.yml b/.github/workflows/check-filebeat.yml new file mode 100644 index 000000000000..6eca3a3d97ce --- /dev/null +++ b/.github/workflows/check-filebeat.yml @@ -0,0 +1,29 @@ +name: check-filebeat + +on: + pull_request: + paths: + - '.github/workflows/check-filebeat.yml' + - 'filebeat/**' + - 'x-pack/filebeat/**' + +env: + BEAT_MODULE: 'filebeat' + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Fetch Go version from .go-version + run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV + - uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + - name: Install libsystemd-dev + run: sudo apt-get install -y libsystemd-dev + - name: Run check/update + run: | + go install github.com/magefile/mage + make -C ${{ env.BEAT_MODULE }} check update + make check-no-changes diff --git a/.github/workflows/check-xpack-filebeat.yml b/.github/workflows/check-xpack-filebeat.yml new file mode 100644 index 000000000000..cd63315b0cd8 --- /dev/null +++ b/.github/workflows/check-xpack-filebeat.yml @@ -0,0 +1,29 @@ +name: check-x-pack-filebeat + +on: + pull_request: + paths: + - '.github/workflows/check-xpack-filebeat.yml' + - 'x-pack/filebeat/**' + - 'filebeat/**' + +env: + BEAT_MODULE: 'x-pack/filebeat' + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Fetch Go version from .go-version + run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV + - uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + - name: Install libpcap-dev + run: sudo apt-get install -y libpcap-dev + - name: Run check/update + run: | + go install github.com/magefile/mage + make -C ${{ env.BEAT_MODULE }} check update + make check-no-changes diff --git a/.github/workflows/opentelemetry.yml b/.github/workflows/opentelemetry.yml index e12caed0ceb5..cd407bef4323 100644 --- a/.github/workflows/opentelemetry.yml +++ b/.github/workflows/opentelemetry.yml @@ -5,9 +5,11 @@ on: workflows: - check-auditbeat - check-dev-tools + - check-filebeat - check-packetbeat - check-winlogbeat - check-x-pack-auditbeat + - check-x-pack-filebeat - check-x-pack-functionbeat - check-x-pack-osquerybeat - check-x-pack-packetbeat diff --git a/filebeat/Jenkinsfile.yml b/filebeat/Jenkinsfile.yml index 05a91f1b435e..4ba771195fe9 100644 --- a/filebeat/Jenkinsfile.yml +++ b/filebeat/Jenkinsfile.yml @@ -13,14 +13,6 @@ when: tags: true ## for all the tags platform: "immutable && ubuntu-18" ## default label for all the stages stages: - checks: - make: | - make -C filebeat check; - make -C filebeat update; - make -C x-pack/filebeat check; - make -C x-pack/filebeat 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/filebeat/Jenkinsfile.yml b/x-pack/filebeat/Jenkinsfile.yml index d639c257cbb1..7383bedac7d6 100644 --- a/x-pack/filebeat/Jenkinsfile.yml +++ b/x-pack/filebeat/Jenkinsfile.yml @@ -13,14 +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/filebeat check; - make -C x-pack/filebeat update; - make -C filebeat check; - make -C filebeat update; - make check-no-changes; - stage: checks arm: mage: "mage build unitTest" platforms: ## override default label in this specific stage.