diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..20e2dc1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + permissions: + contents: read + checks: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + - name: Install xmllint + run: sudo apt-get install -y libxml2-utils + - name: Build + run: go build ./... + - name: Test + run: go test ./... + - name: Selftest + run: make selftest + - name: Publish Test Results + uses: dorny/test-reporter@v1 + if: always() + with: + name: Selftest Results + path: results.xml + reporter: java-junit diff --git a/README.md b/README.md index 1056edb..7ade549 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # shelldoc: Test Unix shell commands in Markdown documentation +[![CI](https://github.com/mirkoboehm/shelldoc/actions/workflows/ci.yml/badge.svg)](https://github.com/mirkoboehm/shelldoc/actions/workflows/ci.yml) + Markdown is widely used for documentation and README.md files that explain how to use or build some software. Such documentation often contains shell commands that explain how to build the software or how to