From 4e7b65d349656723fc0caed41e8db387f0bc1217 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 22 Aug 2022 17:09:10 +0100 Subject: [PATCH 1/3] action: checks for winlogbeat and x-pack/winlogbeat --- .github/workflows/check-winlogbeat.yml | 28 ++++++++++++++++++++ .github/workflows/check-xpack-winlogbeat.yml | 27 +++++++++++++++++++ .github/workflows/opentelemetry.yml | 4 ++- winlogbeat/Jenkinsfile.yml | 8 ------ x-pack/winlogbeat/Jenkinsfile.yml | 10 ------- 5 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/check-winlogbeat.yml create mode 100644 .github/workflows/check-xpack-winlogbeat.yml diff --git a/.github/workflows/check-winlogbeat.yml b/.github/workflows/check-winlogbeat.yml new file mode 100644 index 000000000000..f9f8e645d036 --- /dev/null +++ b/.github/workflows/check-winlogbeat.yml @@ -0,0 +1,28 @@ +name: check-winlogbeat + +on: + pull_request: + paths: + - '.github/workflows/check-winlogbeat.yml' + - 'winlogbeat/**' + - 'x-pack/winlogbeat/**' + +env: + BEAT_MODULE: 'winlogbeat' + +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-winlogbeat.yml b/.github/workflows/check-xpack-winlogbeat.yml new file mode 100644 index 000000000000..b74e2263de2b --- /dev/null +++ b/.github/workflows/check-xpack-winlogbeat.yml @@ -0,0 +1,27 @@ +name: check-x-pack-winlogbeat + +on: + pull_request: + paths: + - '.github/workflows/check-xpack-winlogbeat.yml' + - 'x-pack/winlogbeat/**' + - 'winlogbeat/**' + +env: + BEAT_MODULE: 'x-pack/winlogbeat' + +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..778cdf6a75e2 100644 --- a/.github/workflows/opentelemetry.yml +++ b/.github/workflows/opentelemetry.yml @@ -3,8 +3,10 @@ name: OpenTelemetry Export Trace on: workflow_run: workflows: - - check-x-pack-packetbeat - check-packetbeat + - check-winlogbeat + - check-x-pack-packetbeat + - check-x-pack-winlogbeat - golangci-lint - auditbeat - filebeat diff --git a/winlogbeat/Jenkinsfile.yml b/winlogbeat/Jenkinsfile.yml index bdb09c73cb9d..339fdbc1a2cd 100644 --- a/winlogbeat/Jenkinsfile.yml +++ b/winlogbeat/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 winlogbeat check; - make -C winlogbeat update; - make -C x-pack/winlogbeat check; - make -C x-pack/winlogbeat update; - make check-no-changes; - stage: checks crosscompile: make: "make -C winlogbeat crosscompile" stage: mandatory diff --git a/x-pack/winlogbeat/Jenkinsfile.yml b/x-pack/winlogbeat/Jenkinsfile.yml index 9f3d7096682f..041dde58d205 100644 --- a/x-pack/winlogbeat/Jenkinsfile.yml +++ b/x-pack/winlogbeat/Jenkinsfile.yml @@ -13,16 +13,6 @@ when: tags: true ## for all the tags platform: "windows-2022" ## default label for all the stages stages: - checks: - make: | - make -C x-pack/winlogbeat check; - make -C x-pack/winlogbeat update; - make -C winlogbeat check; - make -C winlogbeat update; - make check-no-changes; - platforms: ## override default labels in this specific stage. - - "immutable && ubuntu-18" - stage: checks build: mage: "mage build unitTest" withModule: true From 414ef8749c45f4f864d654cc768b14b3d9fb5b06 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 23 Aug 2022 10:17:46 +0100 Subject: [PATCH 2/3] As stated in the code review use v3 and avoid latest in favour of go.sum --- .github/workflows/check-winlogbeat.yml | 6 +++--- .github/workflows/check-xpack-winlogbeat.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-winlogbeat.yml b/.github/workflows/check-winlogbeat.yml index f9f8e645d036..a9ebc65c6da0 100644 --- a/.github/workflows/check-winlogbeat.yml +++ b/.github/workflows/check-winlogbeat.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 diff --git a/.github/workflows/check-xpack-winlogbeat.yml b/.github/workflows/check-xpack-winlogbeat.yml index b74e2263de2b..3a18353df6b5 100644 --- a/.github/workflows/check-xpack-winlogbeat.yml +++ b/.github/workflows/check-xpack-winlogbeat.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: Run check/update From 33d6734a7e5de36cd3561c8929bbbca44a701b17 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 23 Aug 2022 14:34:40 +0100 Subject: [PATCH 3/3] action: remove set export PATH --- .github/workflows/check-winlogbeat.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/check-winlogbeat.yml b/.github/workflows/check-winlogbeat.yml index a9ebc65c6da0..41d7b95c0dd9 100644 --- a/.github/workflows/check-winlogbeat.yml +++ b/.github/workflows/check-winlogbeat.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