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

[chore] Run lint and test-race GitHub jobs on Windows #466

Merged
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@ jobs:
path: ~/.tools
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }}
- name: Run linters
run: make multimod-verify dependabot-check license-check lint
run: |
make multimod-verify dependabot-check license-check lint
GOOS=windows make golangci-lint
pellared marked this conversation as resolved.
Show resolved Hide resolved
pellared marked this conversation as resolved.
Show resolved Hide resolved
- name: Build
run: make build
- name: Check clean repository
run: make check-clean-work-tree

test-race:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v5
Expand Down
1 change: 0 additions & 1 deletion chloggen/internal/chlog/summary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
)

func TestSummary(t *testing.T) {

brk1 := Entry{
ChangeType: Breaking,
Component: "foo",
Expand Down
7 changes: 7 additions & 0 deletions multimod/internal/diff/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package diff
import (
"errors"
"path/filepath"
"runtime"
"testing"

"github.com/go-git/go-git/v5"
Expand Down Expand Up @@ -61,6 +62,10 @@ func TestNormalizeTag(t *testing.T) {
}

func TestHasChanged(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("diff does not work on Windows. Tracked under: https://github.com/open-telemetry/opentelemetry-go-build-tools/issues/467.")
}

tests := []struct {
name string
tag string
Expand Down Expand Up @@ -135,9 +140,11 @@ type MockClient struct {
func (c MockClient) HeadCommit(_ *git.Repository) (*object.Commit, error) {
return nil, c.headCommitErr
}

func (c MockClient) TagCommit(_ *git.Repository, _ string) (*object.Commit, error) {
return nil, c.tagCommitErr
}

func (c MockClient) FilesChanged(_ *object.Commit, _ *object.Commit, _ string, _ string) ([]string, error) {
return c.files, nil
}
Expand Down
Loading