From d7c8353989ea8068af63a44ca365152b2c95c36e Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 14 Apr 2023 17:54:48 +0200 Subject: [PATCH] ci: add `merge_queue` trigger for required workflows (#15847) --- .github/workflows/build.yml | 1 + .github/workflows/dependencies-review.yml | 7 ++++++- .github/workflows/lint.yml | 17 ++++++++++++++--- .github/workflows/test.yml | 3 +++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cdb6d35b33b1..5d6e47725ca3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,7 @@ name: Build SimApp # This workflow is run on pushes to main & every Pull Requests where a .go, .mod, .sum have been changed on: pull_request: + merge_group: push: branches: - main diff --git a/.github/workflows/dependencies-review.yml b/.github/workflows/dependencies-review.yml index 6ddd53918b7a..21dd1ae46abc 100644 --- a/.github/workflows/dependencies-review.yml +++ b/.github/workflows/dependencies-review.yml @@ -1,5 +1,7 @@ name: "Dependency Review" -on: pull_request +on: + pull_request: + merge_group: permissions: contents: read @@ -15,6 +17,9 @@ jobs: go-version: 1.20.3 - name: "Dependency Review" uses: actions/dependency-review-action@v3 + with: + base-ref: ${{ github.event.pull_request.base.sha || 'main' }} + head-ref: ${{ github.event.pull_request.head.sha || github.ref }} - name: "Dependency audit" run: ./scripts/dep-assert.sh - name: "Go vulnerability check" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 05c4dad648d0..19fa8a7aa90c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,10 +5,9 @@ on: - main - release/** pull_request: + merge_group: permissions: contents: read - # Optional: allow read access to pull request. Use with `only-new-issues` option. - # pull-requests: read jobs: golangci: name: golangci-lint @@ -18,4 +17,16 @@ jobs: - uses: actions/setup-go@v4 with: go-version: 1.20.3 - - run: make lint + - uses: technote-space/get-diff-action@v6.1.2 + id: git_diff + with: + PATTERNS: | + **/*.go + go.mod + go.sum + **/go.mod + **/go.sum + - name: run linting + if: env.GIT_DIFF + run: | + make lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a018807b818..aaabfb678236 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,7 @@ name: Tests / Code Coverage on: pull_request: + merge_group: push: branches: - main @@ -64,6 +65,8 @@ jobs: go.sum **/go.mod **/go.sum + **/Makefile + Makefile - uses: actions/download-artifact@v3 with: name: "${{ github.sha }}-${{ matrix.part }}"