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
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: write # push the coverage badge to the `badges` branch (main only)

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Run tests
run: go test -race -coverprofile=cover.out ./...

# Root (Docker) action, not /action/source: the source variant compiles the
# tool, which needs a newer Go than go.mod pins — and fails the build.
- name: Coverage badge
uses: vladopajic/go-test-coverage@v2
with:
profile: cover.out
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }}
git-branch: badges
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# pdfdisassembler

[![Test](https://github.com/speedata/pdfdisassembler/actions/workflows/test.yml/badge.svg)](https://github.com/speedata/pdfdisassembler/actions/workflows/test.yml)
[![Coverage](https://github.com/speedata/pdfdisassembler/raw/badges/.badges/main/coverage.svg)](https://github.com/speedata/pdfdisassembler/actions/workflows/test.yml)

A focused, read-only PDF parser for Go. Built for tooling that **inspects**
PDFs — accessibility checkers, validators, debuggers — without dragging in
the writing, optimisation, signing and image-rendering machinery that
Expand Down