diff --git a/.github/workflows/job-test.yml b/.github/workflows/job-test.yml index 686fbac1..821bcd03 100644 --- a/.github/workflows/job-test.yml +++ b/.github/workflows/job-test.yml @@ -23,7 +23,13 @@ jobs: vendir: latest ytt: latest - name: Test - run: go test -v ./... + run: go test -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./... + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + file: ./coverage.txt - uses: goreleaser/goreleaser-action@v4 with: version: latest diff --git a/.gitignore b/.gitignore index 65b8ead6..b5f2c45f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dist .run /myks **/.myks/tmp +coverage.txt diff --git a/internal/myks/git.go b/internal/myks/git.go index dbc2e2f6..5dde9e46 100644 --- a/internal/myks/git.go +++ b/internal/myks/git.go @@ -10,6 +10,7 @@ import ( type ChangedFiles map[string]string // GetChangedFilesGit returns list of files changed since the baseRevision, if specified, and since the last commit +// TODO: exclude files that are outside of the myks root directory func GetChangedFilesGit(baseRevision string) (ChangedFiles, error) { logFn := func(name string, args []string) { log.Debug().Msg(msgRunCmd("collect changed files for smart-mode", name, args))