From 3a88827c9ca41b3742dd3be15708d065063dd662 Mon Sep 17 00:00:00 2001 From: Andreas Bauer Date: Tue, 12 Nov 2024 09:31:59 +0100 Subject: [PATCH 1/7] Split out Linting Jobs into spearate workflow file --- .github/workflows/beta-deployment.yml | 6 ++++ .github/workflows/build-and-test.yml | 32 ------------------ .github/workflows/pull_request.yml | 48 +++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/beta-deployment.yml b/.github/workflows/beta-deployment.yml index a00ca53a..716e1002 100644 --- a/.github/workflows/beta-deployment.yml +++ b/.github/workflows/beta-deployment.yml @@ -18,6 +18,12 @@ jobs: buildandtest: name: Build and Test uses: ./.github/workflows/build-and-test.yml + permissions: + contents: read + secrets: inherit + linting: + name: Lint + uses: ./.github/workflows/pull_request.yml permissions: security-events: write actions: read diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a64997c4..57d054f7 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -14,38 +14,6 @@ on: workflow_call: jobs: - reuse_action: - name: REUSE Compliance Check - uses: StanfordBDHG/.github/.github/workflows/reuse.yml@v2 - permissions: - contents: read - swiftlint: - name: SwiftLint - uses: StanfordBDHG/.github/.github/workflows/swiftlint.yml@v2 - permissions: - contents: read - periphery: - name: Periphery - uses: StanfordSpezi/.github/.github/workflows/periphery.yml@v2 - permissions: - contents: read - with: - runsonlabels: '["macOS", "self-hosted"]' - markdownlinkcheck: - name: Markdown Link Check - uses: StanfordBDHG/.github/.github/workflows/markdown-link-check.yml@v2 - permissions: - contents: read - codeql: - name: CodeQL - uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2 - permissions: - security-events: write - actions: read - contents: read - with: - codeql: true - fastlanelane: codeql buildandtest: name: Build and Test uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 00000000..dce59b97 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,48 @@ +# +# This source file is part of the Stanford Spezi open source project +# +# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: Pull Request + +on: + pull_request: + workflow_dispatch: + workflow_call: + +jobs: + reuse_action: + name: REUSE Compliance Check + uses: StanfordBDHG/.github/.github/workflows/reuse.yml@v2 + permissions: + contents: read + swiftlint: + name: SwiftLint + uses: StanfordBDHG/.github/.github/workflows/swiftlint.yml@v2 + permissions: + contents: read + periphery: + name: Periphery + uses: StanfordSpezi/.github/.github/workflows/periphery.yml@v2 + permissions: + contents: read + with: + runsonlabels: '["macOS", "self-hosted"]' + markdownlinkcheck: + name: Markdown Link Check + uses: StanfordBDHG/.github/.github/workflows/markdown-link-check.yml@v2 + permissions: + contents: read + codeql: + name: CodeQL + uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2 + permissions: + security-events: write + actions: read + contents: read + with: + codeql: true + fastlanelane: codeql \ No newline at end of file From 371ab6eafd6e8d6e474ff00ad1edfa09cb90c309 Mon Sep 17 00:00:00 2001 From: Andreas Bauer Date: Tue, 12 Nov 2024 09:38:30 +0100 Subject: [PATCH 2/7] Rename jobs --- .github/workflows/beta-deployment.yml | 6 +++--- .github/workflows/{pull_request.yml => static_analysis.yml} | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{pull_request.yml => static_analysis.yml} (98%) diff --git a/.github/workflows/beta-deployment.yml b/.github/workflows/beta-deployment.yml index 716e1002..e63867d1 100644 --- a/.github/workflows/beta-deployment.yml +++ b/.github/workflows/beta-deployment.yml @@ -21,9 +21,9 @@ jobs: permissions: contents: read secrets: inherit - linting: - name: Lint - uses: ./.github/workflows/pull_request.yml + staticanaylsis: + name: Static Analysis + uses: ./.github/workflows/static_analysis.yml permissions: security-events: write actions: read diff --git a/.github/workflows/pull_request.yml b/.github/workflows/static_analysis.yml similarity index 98% rename from .github/workflows/pull_request.yml rename to .github/workflows/static_analysis.yml index dce59b97..b0d826c9 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/static_analysis.yml @@ -6,7 +6,7 @@ # SPDX-License-Identifier: MIT # -name: Pull Request +name: Static Analysis on: pull_request: From 0a0ac457e47da957995edadaf1a311404eb6b2f0 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Tue, 12 Nov 2024 12:24:05 -0800 Subject: [PATCH 3/7] Update build-and-test.yml --- .github/workflows/build-and-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 57d054f7..a25b8c1c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -13,6 +13,10 @@ on: workflow_dispatch: workflow_call: +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true + jobs: buildandtest: name: Build and Test From f3d17644009eba17ae0169d617efd87c73d04413 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Tue, 12 Nov 2024 12:24:15 -0800 Subject: [PATCH 4/7] Rename static_analysis.yml to static-analysis.yml --- .github/workflows/{static_analysis.yml => static-analysis.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{static_analysis.yml => static-analysis.yml} (97%) diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static-analysis.yml similarity index 97% rename from .github/workflows/static_analysis.yml rename to .github/workflows/static-analysis.yml index b0d826c9..57027e67 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -45,4 +45,4 @@ jobs: contents: read with: codeql: true - fastlanelane: codeql \ No newline at end of file + fastlanelane: codeql From 82634d3950ee3b085c5761bb4beca594b6c182ec Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Tue, 12 Nov 2024 12:24:42 -0800 Subject: [PATCH 5/7] Update static-analysis.yml --- .github/workflows/static-analysis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 57027e67..3c05eaff 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -13,6 +13,10 @@ on: workflow_dispatch: workflow_call: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: reuse_action: name: REUSE Compliance Check From e77899b16863c42a24b203200ac56ca7efe92460 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Tue, 12 Nov 2024 12:24:50 -0800 Subject: [PATCH 6/7] Update build-and-test.yml --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a25b8c1c..0c7d6c89 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -14,7 +14,7 @@ on: workflow_call: concurrency: - group: build-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: From 8676b993db0484fe9cdd340f6f8231edd27c257f Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Tue, 12 Nov 2024 12:26:51 -0800 Subject: [PATCH 7/7] Update beta-deployment.yml --- .github/workflows/beta-deployment.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/beta-deployment.yml b/.github/workflows/beta-deployment.yml index e63867d1..3cbe893f 100644 --- a/.github/workflows/beta-deployment.yml +++ b/.github/workflows/beta-deployment.yml @@ -14,6 +14,10 @@ on: - main workflow_dispatch: +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + jobs: buildandtest: name: Build and Test