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
3 changes: 1 addition & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# These are supported funding model platforms

github: markbates
patreon: buffalo
github: gopherguides
68 changes: 56 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,66 @@
name: Tests
on: [push]
jobs:

tests-on:
name: ${{matrix.go-version}} ${{matrix.os}}
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
test:
name: Test Go ${{matrix.go-version}} on ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.14.x, 1.15.x]
os: [macos-latest, ubuntu-latest]
go-version: ['1.24.x']
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
fetch-depth: 1
- name: Test
go-version: ${{ matrix.go-version }}
cache-dependency-path: go.sum

- name: Verify Go version
run: go version

- name: Download dependencies
run: go mod download

- name: Verify dependencies
run: go mod verify

- name: Run tests
run: go test -race . ./cmd/remark ./cmd/retoc ./htm ./md

- name: Check formatting
run: |
go mod tidy -v
go test -race ./...
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "Code is not formatted. Please run 'gofmt -s -w .'"
gofmt -s -l .
exit 1
fi
if: runner.os != 'Windows'

- name: Run go vet
run: go vet ./...

- name: Generate coverage report
run: |
mkdir -p .coverage
go test -coverprofile=.coverage/coverage.out . ./cmd/remark ./cmd/retoc ./htm ./md
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.24.x'

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./.coverage/coverage.out
flags: unittests
name: codecov-umbrella
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.24.x'


2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ gin-bin
.idea/
.vscode
cover.out
coverage.out
.coverage/
Loading
Loading