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@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 with: egress-policy: audit - name: Checkout Repo uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 persist-credentials: false - name: Setup Go uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.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 }}