diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..df60768d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "**" ] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + cache: false + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.55.2 + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + cache: false + + - name: Test + uses: robherley/go-test-action@v0.1.0 + with: + testArguments: './pkg/... -coverprofile=./cover.out' + + - name: Check coverage + uses: vladopajic/go-test-coverage@v2 + if: always() + with: + config: ./.testcoverage.yml \ No newline at end of file diff --git a/.testcoverage.yml b/.testcoverage.yml new file mode 100644 index 00000000..f09fcb5c --- /dev/null +++ b/.testcoverage.yml @@ -0,0 +1,10 @@ +profile: cover.out +threshold: + file: 80 + package: 80 + total: 80 + +exclude: + paths: + - ^pkg/internal + - ^pkg/config