Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add ci.yaml to exclude from ci-docs triggers #1163

Closed
Closed
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
2 changes: 2 additions & 0 deletions .github/workflows/ci-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:
- '!.github/workflows/e2e-macos.yaml'
- '!.github/workflows/e2e-windows.yaml'
- '!.github/workflows/e2e-linux.yaml'
- '!.github/workflows/ci.yaml'
pull_request:
branches:
- main
Expand All @@ -39,6 +40,7 @@ on:
- '!.github/workflows/e2e-macos.yaml'
- '!.github/workflows/e2e-windows.yaml'
- '!.github/workflows/e2e-linux.yaml'
- '!.github/workflows/ci.yaml'

jobs:
git-secrets:
Expand Down
33 changes: 32 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- '.github/workflows/e2e-macos.yaml'
- '.github/workflows/e2e-windows.yaml'
- '.github/workflows/e2e-linux.yaml'
- '.github/workflows/ci.yaml'
- 'contrib/packaging/**'
- 'deps/**'
- 'finch.yaml.d/**'
Expand All @@ -27,6 +28,7 @@ on:
- '.github/workflows/e2e-macos.yaml'
- '.github/workflows/e2e-windows.yaml'
- '.github/workflows/e2e-linux.yaml'
- '.github/workflows/ci.yaml'
- 'contrib/packaging/**'
- 'deps/**'
- 'finch.yaml.d/**'
Expand Down Expand Up @@ -201,7 +203,36 @@ jobs:
arch: ${{ matrix.arch }}
version: ${{ matrix.version }}
runner-type: ${{ matrix.runner-type }}

macos-unit-test-coverage:
runs-on: macos-latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should just add a unit-test-coverage step to the existing unit-tests workflow, instead of creating an entirely new workflow.

We also don't even need to use multiple runners for this, we can use the default ubuntu-latest and set GOOS as needed, per platform, like the linting workflow

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noted, this i meant to try out things only intention was the exclude, but if we have it in the unit test flow we probably dont need it will cancel this one.

strategy:
fail-fast: false
matrix:
version: ['13', '14']
arch: ['X64', 'arm64']
macos-unit-test-coverage:
name: Run Unit Tests with Coverage
runs-on: macos-latest
steps:
- name: Configure git CRLF settings
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
cache: false
- run:
PKG_COVERAGE=$(paste -sd, test-coverage/macos.txt)
go test -cover -coverpkg="${PKG_COVERAGE}" -coverprofile=coverage.out ./...
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}')
if (( $(echo "$COVERAGE < 75" | bc -l) )); then
echo "Coverage $COVERAGE% is below 75% threshold"
exit 1
else
echo "Coverage is $COVERAGE%, which meets the threshold"
fi
mdlint:
runs-on: ubuntu-latest
steps:
Expand Down
15 changes: 15 additions & 0 deletions test-coverage/macos.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
./cmd/finch
./pkg/command
./pkg/config
./pkg/dependency
./pkg/disk
./pkg/flog
./pkg/fmemory
./pkg/fssh
./pkg/lima
./pkg/path
./pkg/support
./pkg/system
./pkg/templates
./pkg/version
./pkg/winutil