Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ runs:
shell: bash

- name: Run tests
run: go test -v ./...
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
shell: bash
13 changes: 13 additions & 0 deletions .github/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
coverage:
status:
project:
default:
target: 80%
threshold: 0%
if_ci_failed: error
patch:
default:
target: 80%
threshold: 0%
if_ci_failed: error
only_pulls: true
35 changes: 35 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CodeQL

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "27 4 * * 1" # weekly, Monday ~04:27 UTC

permissions:
contents: read
security-events: write

jobs:
analyze:
name: Analyze (Go)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26"

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: go
build-mode: autobuild

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
11 changes: 11 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Pull Request
on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
test:
Expand All @@ -18,3 +21,11 @@ jobs:

- name: Test
uses: ./.github/actions/test

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt
fail_ci_if_error: false
8 changes: 8 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ jobs:
- name: Test
uses: ./.github/actions/test

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt
fail_ci_if_error: false

release:
name: Release
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Release](https://img.shields.io/github/v/release/borisdvlpr/gotail)](https://github.com/borisdvlpr/gotail/releases)
[![CI](https://github.com/borisdvlpr/gotail/actions/workflows/pull-request.yaml/badge.svg)](https://github.com/borisdvlpr/gotail/actions/workflows/pull-request.yaml)
[![Codecov](https://codecov.io/github/borisdvlpr/gotail/graph/badge.svg?token=QJTVO5NX58)](https://codecov.io/github/borisdvlpr/gotail)
[![License](https://img.shields.io/github/license/borisdvlpr/gotail)](LICENSE)
[![OSS hosting by Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith)](https://cloudsmith.com)

Expand Down
Loading