From f3e011bfa0cb614ae101f8792500393d47478726 Mon Sep 17 00:00:00 2001 From: tom twinkle Date: Mon, 25 Mar 2024 12:43:31 +0900 Subject: [PATCH] hashutil add test --- .github/workflows/test-hashutil.yaml | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/test-hashutil.yaml diff --git a/.github/workflows/test-hashutil.yaml b/.github/workflows/test-hashutil.yaml new file mode 100644 index 0000000..67bb05c --- /dev/null +++ b/.github/workflows/test-hashutil.yaml @@ -0,0 +1,52 @@ +name: Test hashutil + +on: + push: + branches: + - main + paths: + - "hashutil/**" + pull_request: + types: + - opened + - synchronize + - reopened + paths: + - "hashutil/**" +env: + testdir : ./hashutil + +jobs: + test: + strategy: + matrix: + go-version: [ 1.22.x ] + os: [ ubuntu-latest ] + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Go Module Download + working-directory: ${{ env.testdir }} + run: | + go install gotest.tools/gotestsum@latest + go mod download + + - name: Test + working-directory: ${{ env.testdir }} + timeout-minutes: 3 + run: | + # shellcheck disable=SC2046 + gotestsum --junitfile unit-tests.xml -- -v ./... -race -coverprofile="coverage.txt" -covermode=atomic -coverpkg=./... + + - uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ env.testdir }}/coverage.txt