From 3af834720d392c3b7137b2a5dcc026fab05fc71c Mon Sep 17 00:00:00 2001 From: Alex Ellwein Date: Fri, 15 Apr 2022 20:52:11 +0200 Subject: [PATCH] add test coverage to the pipeline --- .github/workflows/go.yml | 28 ++++++++++++++++++++++++++-- .gitignore | 1 + 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 20b1873..69dc28b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -13,8 +13,10 @@ jobs: matrix: go: ["1.16", "1.17", "1.18"] steps: - - uses: actions/checkout@v3 - - name: Set up Go + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Go ${{ matrix.go }} uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} @@ -24,3 +26,25 @@ jobs: - name: Test run: go test ./... + codecov: + name: codecov + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.17 + uses: actions/setup-go@v3 + with: + go-version: "1.17" + + - name: Checkout + uses: actions/checkout@v3 + + - name: Generate coverage report + run: | + go test ./... -coverprofile=coverage.txt -covermode=atomic + + - name: Upload coverage report + uses: codecov/codecov-action@v3 + with: + files: ./coverage.txt + flags: unittests + name: codecov diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..36946b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +coverage.txt \ No newline at end of file