Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,17 @@ jobs:

- name: Build with rsync tag
run: go build -tags rsync ./...

- name: Test with rsync tag
run: go test -tags rsync ./...
run: go test -race -tags rsync -coverprofile=coverage-rsync.out ./...

- name: Show rsync coverage
if: always() && hashFiles('coverage-rsync.out') != ''
run: go tool cover -func=coverage-rsync.out | tail -n 1

- name: Upload rsync coverage
if: always() && hashFiles('coverage-rsync.out') != ''
uses: actions/upload-artifact@v4
with:
name: coverage-rsync
path: coverage-rsync.out
if-no-files-found: error
16 changes: 14 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,18 @@ jobs:

- name: Build with rsync tag
run: go build -tags rsync ./...

- name: Test with rsync tag
run: go test -tags rsync ./...
run: go test -race -tags rsync -coverprofile=coverage-rsync.out ./...

- name: Show rsync coverage (summary)
if: always() && hashFiles('coverage-rsync.out') != ''
run: |
go tool cover -func=coverage-rsync.out | tail -n 1 | tee -a "$GITHUB_STEP_SUMMARY"

- name: Upload rsync coverage
if: always() && hashFiles('coverage-rsync.out') != ''
uses: actions/upload-artifact@v4
with:
name: coverage-rsync
path: coverage-rsync.out
if-no-files-found: error
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ make coverage

This command writes `coverage.out` and prints function coverage details.

## Rsync-tagged tests

Some packages require the `rsync` build tag. Run their tests locally with the tag enabled:

```sh
go test -tags rsync ./...
```

To include coverage for these tests:

```sh
go test -tags rsync -coverprofile=coverage-rsync.out ./...
go tool cover -func=coverage-rsync.out
```

## Sudoers file validation

CI also checks the syntax of the sample sudoers rules:
Expand Down
Loading