diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c44774ad..4a2bd634 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,28 +19,32 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Setup Go - uses: actions/setup-go@v6 + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 with: go-version-file: go.mod cache: true - name: Setup Task - uses: arduino/setup-task@v2 + uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v2.0.0 - name: golangci-lint - uses: golangci/golangci-lint-action@v9 + uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9 - name: Test run: task test-coverage - name: Upload coverage - uses: codecov/codecov-action@v6 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6 with: - file: ./coverage.out + files: ./coverage.out + flags: unittests + slug: omarluq/librecode token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true build: name: Build @@ -55,10 +59,10 @@ jobs: goarch: arm64 steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Setup Go - uses: actions/setup-go@v6 + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 with: go-version-file: go.mod cache: true @@ -74,7 +78,7 @@ jobs: go build -v -o bin/librecode-${{ matrix.goos }}-${{ matrix.goarch }}${ext} ./cmd/librecode - name: Upload artifact - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: librecode-${{ matrix.goos }}-${{ matrix.goarch }} path: bin/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 48cc65a1..1fee7f0e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,18 +13,18 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 - name: Setup Go - uses: actions/setup-go@v6 + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 with: go-version-file: go.mod cache: true - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v7 + uses: goreleaser/goreleaser-action@1a80836c5c9d9e5755a25cb59ec6f45a3b5f41a8 # v7 with: distribution: goreleaser version: "~> v2" diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..1d47faa9 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,17 @@ +coverage: + status: + project: + default: + target: auto + threshold: 2% + patch: + default: + target: 70% + threshold: 5% + +ignore: + - "bench/**" + - "cmd/**" + - "docs/**" + - "extensions/**" + - "**/*_test.go"