diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..616c518 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,36 @@ +name: coverage + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +jobs: + coverage: + name: Test coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-go@v6 + with: + go-version-file: go.mod + cache: true + + - name: Build frontend + working-directory: app + run: npm ci && npm run build + + - name: Run tests with coverage + run: go test -count=1 -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Upload coverage to Codecov + if: ${{ secrets.CODECOV_TOKEN != '' }} + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.txt + fail_ci_if_error: false diff --git a/README.es.md b/README.es.md index ab5c3af..f8a9cbc 100644 --- a/README.es.md +++ b/README.es.md @@ -10,6 +10,7 @@ Demo en vivo Release Licencia + Cobertura

diff --git a/README.md b/README.md index 52598de..d71af57 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Live demo Release License + Coverage