Skip to content

feat: add support for named filter arguments (fixes #42) #176

feat: add support for named filter arguments (fixes #42)

feat: add support for named filter arguments (fixes #42) #176

Workflow file for this run

name: Build Status

Check failure on line 1 in .github/workflows/go.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/go.yml

Invalid workflow file

(Line: 69, Col: 11): Unrecognized named-value: 'secrets'. Located at position 75 within expression: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && secrets.GIST_SECRET != ''
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.24.x
- name: Install dependencies
run: make deps
- name: Install tools
run: make tools
- name: Build
run: make build
- name: Run go vet
run: make vet
- name: Test
run: make test
coverage:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.24.x
- name: Install dependencies
run: make deps
- name: Generate coverage report
run: make coverage
- name: Extract coverage percentage
id: coverage
run: |
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
echo "percentage=$COVERAGE" >> $GITHUB_OUTPUT
echo "Coverage: $COVERAGE%"
- name: Create coverage badge
uses: schneegans/[email protected]
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && secrets.GIST_SECRET != ''
continue-on-error: true
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: ${{ secrets.GIST_ID }}
filename: liquid-coverage.json
label: coverage
message: ${{ steps.coverage.outputs.percentage }}%
color: ${{ steps.coverage.outputs.percentage > 80 && 'green' || steps.coverage.outputs.percentage > 60 && 'yellow' || 'red' }}
- name: Add coverage to summary
run: |
echo "## Coverage Report" >> $GITHUB_STEP_SUMMARY
echo "Total coverage: ${{ steps.coverage.outputs.percentage }}%" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Per-package coverage:" >> $GITHUB_STEP_SUMMARY
go tool cover -func=coverage.out | grep -v "total:" | awk '{printf "- %s: %s\n", $2, $3}' >> $GITHUB_STEP_SUMMARY
verify-mod:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.24.x
- name: Check go.mod
run: make check-mod