From 3e4587afbffebcd6481f0ac4a90c0a950cb2d480 Mon Sep 17 00:00:00 2001 From: Daisuke Maki Date: Sun, 24 Jan 2021 23:26:25 +0900 Subject: [PATCH] test both stdlib and goccy --- .github/workflows/ci.yml | 3 ++- Makefile | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef87ad4df..98ed32949 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: + json_backend: [ 'stdlib', 'goccy' ] go: [ '1.15.x', '1.14.x' ] name: Go ${{ matrix.go }} test steps: @@ -44,7 +45,7 @@ jobs: run: sudo apt-get install -y --no-install-recommends jose - run: make generate - name: Test with coverage - run: make cover + run: make cover-${{ matrix.json_backend }} - name: Upload code coverage to codecov if: matrix.go == '1.15.x' uses: codecov/codecov-action@v1 diff --git a/Makefile b/Makefile index 0e6b057e1..8f6dd4257 100644 --- a/Makefile +++ b/Makefile @@ -15,12 +15,22 @@ test: cd examples && go test -v -race && cd .. && go test -v -race ./... cover: + $(MAKE) cover-stdlib + +cover-stdlib: cd examples && go test -v -race && cd .. && go test -v -race -coverpkg=./... -coverprofile=coverage.out.tmp ./... @# This is NOT cheating. tools to generate code don't need to be @# included in the final result @cat coverage.out.tmp | grep -v "internal/cmd" > coverage.out @rm coverage.out.tmp +cover-goccy: + cd examples && go test -v -tags jwx_goccy -race && cd .. && go test -v -tags jwx_goccy -race -coverpkg=./... -coverprofile=coverage.out.tmp ./... + @# This is NOT cheating. tools to generate code don't need to be + @# included in the final result + @cat coverage.out.tmp | grep -v "internal/cmd" > coverage.out + @rm coverage.out.tmp + smoke: cd examples && go test -race && cd .. && go test -race -short ./...