forked from shurcooL/graphql
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
565 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ on: | |
jobs: | ||
test-go: | ||
name: Run Go lint and unit tests | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
# Required: allow read access to the content for analysis. | ||
|
@@ -26,14 +26,6 @@ jobs: | |
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.20" | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Install dependencies | ||
run: | | ||
go get -t -v ./... | ||
|
@@ -47,13 +39,11 @@ jobs: | |
cd ./example/hasura | ||
docker-compose up -d | ||
- name: Lint | ||
uses: golangci/golangci-lint-action@v4 | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: latest | ||
only-new-issues: true | ||
skip-cache: true | ||
skip-pkg-cache: true | ||
skip-build-cache: true | ||
args: --timeout=120s | ||
- name: Run Go unit tests for example/subscription | ||
run: | | ||
|
@@ -63,13 +53,13 @@ jobs: | |
- name: Run Go unit tests | ||
run: go test -v -race -timeout 3m -coverprofile=coverage.out ./... | ||
- name: Go coverage format | ||
if: ${{ github.event_name == 'pull_request' }} | ||
if: ${{ github.event_name == 'pull_request' && github.repository == 'hasura/go-graphql-client' }} | ||
run: | | ||
go get github.com/boumenot/gocover-cobertura | ||
go install github.com/boumenot/gocover-cobertura | ||
gocover-cobertura < coverage.out > coverage.xml | ||
- name: Code Coverage Summary Report | ||
if: ${{ github.event_name == 'pull_request' }} | ||
if: ${{ github.event_name == 'pull_request' && github.repository == 'hasura/go-graphql-client' }} | ||
uses: irongut/[email protected] | ||
with: | ||
filename: coverage.xml | ||
|
@@ -83,7 +73,7 @@ jobs: | |
thresholds: "60 80" | ||
- name: Add Coverage PR Comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
if: ${{ github.event_name == 'pull_request' && github.repository == 'hasura/go-graphql-client' }} | ||
with: | ||
path: code-coverage-results.md | ||
- name: Dump docker logs on failure | ||
|
Oops, something went wrong.