| 1 |
name: CI |
| 2 |
on: [push, pull_request] |
| 3 |
jobs: |
| 4 |
test-and-coverage: |
| 5 |
strategy: |
| 6 |
matrix: |
| 7 |
os: [macos-latest, windows-latest, ubuntu-latest] |
| 8 |
runs-on: ${{ matrix.os }} |
| 9 |
steps: |
| 10 |
- name: Check out repository |
| 11 |
uses: actions/checkout@v4 |
| 12 |
- name: Setup go |
| 13 |
uses: actions/setup-go@v5 |
| 14 |
with: |
| 15 |
go-version-file: './go.mod' |
| 16 |
- name: Test |
| 17 |
run: make tests |
| 18 |
- name: Setup go with oldstable version for lcov |
| 19 |
if: matrix.os == 'ubuntu-latest' |
| 20 |
uses: actions/setup-go@v5 |
| 21 |
with: |
| 22 |
go-version: 'oldstable' |
| 23 |
- name: Convert Go coverage to lcov |
| 24 |
if: matrix.os == 'ubuntu-latest' |
| 25 |
run: | |
| 26 |
go install github.com/jandelgado/gcov2lcov@latest |
| 27 |
gcov2lcov -infile=coverage.out -outfile=coverage.lcov |
| 28 |
- name: Upload coverage to Coveralls |
| 29 |
if: matrix.os == 'ubuntu-latest' |
| 30 |
uses: coverallsapp/github-action@v2 |
| 31 |
|
| 32 |
format-markdown: |
| 33 |
runs-on: ubuntu-latest |
| 34 |
|
| 35 |
steps: |
| 36 |
- name: Checkout |
| 37 |
uses: actions/checkout@v4 |
| 38 |
|
| 39 |
- name: Format Markdown with markdownlint |
| 40 |
run: | |
| 41 |
npm install -g markdownlint-cli |
| 42 |
markdownlint --disable MD013 --fix . --ignore CODE_OF_CONDUCT.md |
| 43 |
git add -A |
| 44 |
git diff --cached --exit-code |