name: Run tests and upload coverage on: workflow_call: pull_request: branches: [main] paths: - shoutrrr/** - pkg/** - internal/** - shoutrrr.go - go.mod - go.sum permissions: contents: read # Set default read-only permissions jobs: test: name: Run Tests and Upload Coverage Report runs-on: ${{ matrix.platform }} strategy: fail-fast: false matrix: platform: - macos-latest - windows-2025 - ubuntu-latest steps: - name: Harden the Runner (Step Security) uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1 with: egress-policy: audit - name: Checkout Repo uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - name: Setup Go uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: cache: true cache-dependency-path: "**/go.sum" go-version-file: go.mod - name: Install Dependencies run: go mod download - name: Run Tests shell: bash run: | go list ./... | grep -vE '/testing/e2e(/|$)' | xargs go test -v -coverprofile coverage.out -covermode atomic - name: Upload Coverage Report to Codecov uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: token: ${{ secrets.CODECOV_TOKEN }}