From 9ea44c5602d2ff1b3a2b614cf09f0e1195bfa87c Mon Sep 17 00:00:00 2001 From: xxxVitoxxx Date: Mon, 25 Sep 2023 21:37:10 +0800 Subject: [PATCH] chore: add lint action --- .github/workflows/testing.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/testing.yml diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 0000000..7142b0d --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,44 @@ +name: Lint and Testing + +on: + push: + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: "1.20" + - name: Setup golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest + + tests: + runs-on: ubuntu-latest + container: golang:1.20-alpine + steps: + - uses: actions/checkout@v4 + - name: Testing + run: | + go test -v -cover -coverprofile coverage.txt ./... && echo "\n==>\033[32m Ok\033[m\n" || exit 1 + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + testss: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: "1.20" + - name: Test with the Go CLI + run: | + go test -v -cover -coverprofile coverage.txt ./... && echo "\n==>\033[32m Ok\033[m\n" || exit 1