From d4639acab4f62808c9e7c5d85bd45bc4d9df0569 Mon Sep 17 00:00:00 2001 From: Galen Liu Date: Tue, 26 Nov 2024 17:58:52 +0800 Subject: [PATCH] configure readme and github action --- .github/workflows/go.yml | 24 +++++++++++++++--------- README.md | 8 +++++++- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0ee7422..620cfaa 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,15 +14,21 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' + - name: Set up Go + uses: actions/setup-go@v5 - - name: Build - run: go build -v ./... + - name: Install dependencies + run: go mod download - - name: Test - run: go test -v ./... + - name: Run tests + run: go test -coverprofile=coverage.txt + + - name: Upload results to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 340cd9b..72c1c27 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -[![Build Status](https://travis-ci.org/liugang/gojson.svg?branch=master)](https://travis-ci.org/liugang/gojson) +# gojson + +[![GitHub Actions](https://github.com/liugang/gojson/actions/workflows/go.yml/badge.svg)](https://github.com/liugang/gojson/actions) +[![codecov](https://codecov.io/gh/liugang/gojson/branch/master/graph/badge.svg)](https://codecov.io/gh/liugang/gojson) +[![Go Report Card](https://goreportcard.com/badge/github.com/liugang/gojson)](https://goreportcard.com/report/github.com/liugang/gojson) +[![GoDoc](https://godoc.org/github.com/liugang/gojson?status.svg)](https://godoc.org/github.com/liugang/gojson) + gojson ======