From 14c8c0e0b661bba0daa76b007bbeb73b27dd426f Mon Sep 17 00:00:00 2001 From: dxyinme Date: Wed, 4 Sep 2024 23:38:13 +0800 Subject: [PATCH] update test --- .github/workflows/test.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7bcba61 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +name: Testing + +on: + push: + branches: [ "master", "develop" ] + pull_request: + branches: [ "master", "develop" ] + +jobs: + + tests: + name: Test on go ${{ matrix.go_version }} + strategy: + matrix: + go_version: [ + "1.19", + "1.20", + "1.21", + ] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go_version }} + + - name: Test + run: go test -v -timeout 30m -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file