diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2d48175371..05694cb902 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 @@ -44,8 +49,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 +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: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh + - run: make depend; go build goa.design/goa/v3/cmd/goa - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/deep-source.yml b/.github/workflows/report-coverage.yml similarity index 81% rename from .github/workflows/deep-source.yml rename to .github/workflows/report-coverage.yml index d0066049ed..80a37e4a37 100644 --- a/.github/workflows/deep-source.yml +++ b/.github/workflows/report-coverage.yml @@ -1,22 +1,28 @@ name: Report Test Coverage -on: + +on: workflow_run: - workflows: - - Run Tests and Static Analysis + workflows: + - Run Static Checks and Tests types: [completed] jobs: - upload: + report: runs-on: ubuntu-latest if: github.event.workflow_run.conclusion == 'success' + 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 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 94% rename from .github/workflows/build.yml rename to .github/workflows/test.yml index 1c29a28dea..a9a41fb5fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,5 @@ -name: Run Tests and Static Analysis +name: Run Static Checks and Tests + on: push: branches: @@ -15,16 +16,20 @@ jobs: go: ['1.20', '1.21'] 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 if: matrix.go == '1.21' && matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v3