From c047a476623b1a5c04808d0c1acbd87cc7ed8ad8 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:45:06 +0200 Subject: [PATCH] github-actions: bump versions, remove obsoleted tools and remove support for Windows linting (#3806) (#3807) --- .github/workflows/golangci-lint.yml | 10 ++++------ .github/workflows/pre-commit.yml | 27 +++++++++++++++++++++++++++ .github/workflows/pull-request.yml | 8 +++----- .pre-commit-config.yaml | 1 - 4 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 719a329678..b274fd3eb0 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -10,16 +10,14 @@ jobs: golangci: strategy: matrix: - os: [ ubuntu-latest, windows-latest ] + os: [ ubuntu-latest ] name: lint runs-on: ${{ matrix.os }} 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 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: .go-version - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000000..fe178fdf0b --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,27 @@ +--- +name: pre-commit + +on: + push: + branches: + - 'main' + - '8**' + - '7.17' + pull_request: + +# limit the access of the generated GITHUB_TOKEN +permissions: + contents: read + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version-file: .go-version + - uses: actions/setup-python@v3 + - name: Install dependencies + run: .ci/scripts/install-dependencies.sh + - uses: elastic/apm-pipeline-library/.github/actions/pre-commit@current diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 26d29c2f14..c552909557 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -14,12 +14,10 @@ jobs: name: Run Test 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 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: .go-version cache: true cache-dependency-path: go.sum - name: build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 625ad4fe9c..3f5553de5d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,6 @@ repos: rev: v0.5.0 hooks: - id: go-fmt - - id: go-lint - id: no-go-testing - id: golangci-lint args: ["--fix", "--fast", "--new"]