From b07fed75bd1e2da6460ac84a7db657f20e88768f Mon Sep 17 00:00:00 2001 From: Raphael Simon Date: Thu, 28 Sep 2023 22:41:03 -0700 Subject: [PATCH 1/9] Try fixing the DeepSource workflow not triggering --- .github/workflows/build.yml | 2 +- .github/workflows/deep-source.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c29a28dea..50afb9902e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Run Tests and Static Analysis +name: "Run Tests and Static Analysis" on: push: branches: diff --git a/.github/workflows/deep-source.yml b/.github/workflows/deep-source.yml index d0066049ed..3ac3ed394a 100644 --- a/.github/workflows/deep-source.yml +++ b/.github/workflows/deep-source.yml @@ -2,7 +2,7 @@ name: Report Test Coverage on: workflow_run: workflows: - - Run Tests and Static Analysis + - "Run Tests and Static Analysis" types: [completed] jobs: From d78855fe4e138dbf031f80af1461ab7875dadb46 Mon Sep 17 00:00:00 2001 From: Raphael Simon Date: Thu, 28 Sep 2023 22:49:09 -0700 Subject: [PATCH 2/9] Try something else --- .github/workflows/build.yml | 12 +++++++----- .github/workflows/deep-source.yml | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50afb9902e..1e9d7db8ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: "Run Tests and Static Analysis" +name: Run Tests and Static Analysis on: push: branches: @@ -12,17 +12,19 @@ jobs: strategy: fail-fast: true matrix: - go: ['1.20', '1.21'] - os: ['ubuntu-latest', 'windows-latest'] + # go: ['1.20', '1.21'] + go: ['1.21'] + os: ['ubuntu-latest'] + # os: ['ubuntu-latest', 'windows-latest'] runs-on: ${{ matrix.os }} steps: + - name: Check out code + uses: actions/checkout@v4 - name: Set up Go ${{ matrix.go }} uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} id: go - - name: Check out code - uses: actions/checkout@v4 - name: Build run: make ci - name: Upload test coverage for deep source diff --git a/.github/workflows/deep-source.yml b/.github/workflows/deep-source.yml index 3ac3ed394a..ab4c17eb8d 100644 --- a/.github/workflows/deep-source.yml +++ b/.github/workflows/deep-source.yml @@ -2,11 +2,11 @@ name: Report Test Coverage on: workflow_run: workflows: - - "Run Tests and Static Analysis" + - build types: [completed] jobs: - upload: + report: runs-on: ubuntu-latest if: github.event.workflow_run.conclusion == 'success' steps: From 560d9073a32b8b753698117537ea989336ccbf01 Mon Sep 17 00:00:00 2001 From: Raphael Simon Date: Thu, 28 Sep 2023 22:52:32 -0700 Subject: [PATCH 3/9] Try again --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e9d7db8ef..7c9450d664 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Run Tests and Static Analysis +name: build on: push: branches: From 7de65026b6e713cecdc296a71136b161f3e40a58 Mon Sep 17 00:00:00 2001 From: Raphael Simon Date: Thu, 28 Sep 2023 23:12:27 -0700 Subject: [PATCH 4/9] Try something else --- .../{deep-source.yml => report-coverage.yml} | 12 ++++++++---- .github/workflows/{build.yml => test.yml} | 7 ++++++- 2 files changed, 14 insertions(+), 5 deletions(-) rename .github/workflows/{deep-source.yml => report-coverage.yml} (88%) rename .github/workflows/{build.yml => test.yml} (95%) diff --git a/.github/workflows/deep-source.yml b/.github/workflows/report-coverage.yml similarity index 88% rename from .github/workflows/deep-source.yml rename to .github/workflows/report-coverage.yml index ab4c17eb8d..25eb8be2ea 100644 --- a/.github/workflows/deep-source.yml +++ b/.github/workflows/report-coverage.yml @@ -1,22 +1,26 @@ name: Report Test Coverage -on: + +on: workflow_run: - workflows: - - build - types: [completed] + workflows: ["Run Static Checks and Tests"] + types: + - completed jobs: report: runs-on: ubuntu-latest if: github.event.workflow_run.conclusion == 'success' + steps: - name: Check out code uses: actions/checkout@v4 + - name: Download test coverage uses: actions/download-artifact@v3 with: name: coverage path: cover.out + - name: Report analysis to DeepSource run: | curl https://deepsource.io/cli | sh diff --git a/.github/workflows/build.yml b/.github/workflows/test.yml similarity index 95% rename from .github/workflows/build.yml rename to .github/workflows/test.yml index 7c9450d664..5b8fe54a8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,5 @@ -name: build +name: Run Static Checks and Tests + on: push: branches: @@ -17,16 +18,20 @@ jobs: os: ['ubuntu-latest'] # os: ['ubuntu-latest', 'windows-latest'] runs-on: ${{ matrix.os }} + steps: - name: Check out code uses: actions/checkout@v4 + - name: Set up Go ${{ matrix.go }} uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} id: go + - name: Build run: make ci + - name: Upload test coverage for deep source if: matrix.go == '1.21' && matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v3 From 6299a9c5fa3b3f36de5d2a76268d1f8561e84c06 Mon Sep 17 00:00:00 2001 From: Raphael Simon Date: Thu, 28 Sep 2023 23:23:05 -0700 Subject: [PATCH 5/9] attempt 5 --- .github/workflows/codeql.yml | 8 +++----- .github/workflows/report-coverage.yml | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2d48175371..9b0f81b45c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -44,8 +44,8 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 + #- name: Autobuild + # uses: github/codeql-action/autobuild@v2 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -53,9 +53,7 @@ jobs: # If the Autobuild fails above, remove it and uncomment the following three lines. # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh + - run: make depend; go build cmd/goa - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/report-coverage.yml b/.github/workflows/report-coverage.yml index 25eb8be2ea..388a703e54 100644 --- a/.github/workflows/report-coverage.yml +++ b/.github/workflows/report-coverage.yml @@ -2,9 +2,8 @@ name: Report Test Coverage on: workflow_run: - workflows: ["Run Static Checks and Tests"] - types: - - completed + workflows: [build] + types: [completed] jobs: report: From 7f14991178ac896064b7cba006aaeda9aced4af8 Mon Sep 17 00:00:00 2001 From: Raphael Simon Date: Thu, 28 Sep 2023 23:30:35 -0700 Subject: [PATCH 6/9] Fix --- .github/workflows/codeql.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9b0f81b45c..95d1628be9 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,6 +29,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 From c2e22fd508e7532d01b002a5039e7d6e6d140fcc Mon Sep 17 00:00:00 2001 From: Raphael Simon Date: Thu, 28 Sep 2023 23:34:05 -0700 Subject: [PATCH 7/9] Fix --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 95d1628be9..05694cb902 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -58,7 +58,7 @@ jobs: # If the Autobuild fails above, remove it and uncomment the following three lines. # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - run: make depend; go build cmd/goa + - run: make depend; go build goa.design/goa/v3/cmd/goa - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 From baa9dca72889417b5e5788b0418a4c0a53ef60be Mon Sep 17 00:00:00 2001 From: Raphael Simon Date: Thu, 28 Sep 2023 23:35:18 -0700 Subject: [PATCH 8/9] Fix --- .github/workflows/report-coverage.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/report-coverage.yml b/.github/workflows/report-coverage.yml index 388a703e54..bc3cc40581 100644 --- a/.github/workflows/report-coverage.yml +++ b/.github/workflows/report-coverage.yml @@ -2,7 +2,8 @@ name: Report Test Coverage on: workflow_run: - workflows: [build] + workflows: + - Run Static Checks and Tests types: [completed] jobs: From 6cdecf59313c1e910d394a12398be6196969de94 Mon Sep 17 00:00:00 2001 From: Raphael Simon Date: Thu, 28 Sep 2023 23:46:48 -0700 Subject: [PATCH 9/9] More tweaks --- .github/workflows/report-coverage.yml | 2 ++ .github/workflows/test.yml | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/report-coverage.yml b/.github/workflows/report-coverage.yml index bc3cc40581..80a37e4a37 100644 --- a/.github/workflows/report-coverage.yml +++ b/.github/workflows/report-coverage.yml @@ -14,6 +14,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 + with: + ref: ${{ github.event.workflow_run.head_branch }} - name: Download test coverage uses: actions/download-artifact@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b8fe54a8a..a9a41fb5fe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,10 +13,8 @@ jobs: strategy: fail-fast: true matrix: - # go: ['1.20', '1.21'] - go: ['1.21'] - os: ['ubuntu-latest'] - # os: ['ubuntu-latest', 'windows-latest'] + go: ['1.20', '1.21'] + os: ['ubuntu-latest', 'windows-latest'] runs-on: ${{ matrix.os }} steps: