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 CI #153

Closed
wants to merge 2 commits into from
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
12 changes: 4 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
{
"name": "go test",
"on": ["push", "pull_request"],
"on": ["push"],
"jobs": {
"test": {
"strategy": {
"matrix": {
"go-version": ["1.18.x", "1.21.x"],
"go-version": ["1.18.x", "1.22.x"],
"os": ["ubuntu-latest", "macos-latest", "windows-latest"]
}
},
"runs-on": "${{ matrix.os }}",
"steps": [
{
"name": "Install Go",
"uses": "actions/setup-go@v2",
"uses": "actions/setup-go@v5",
"with": {"go-version": "${{ matrix.go-version }}"}
},
{
"name": "Checkout code",
"uses": "actions/checkout@v2"
"uses": "actions/checkout@v4"
},
{
"name": "Test",
"run": "go test -v ./..."
},
{
"name": "Install",
"run": "go install -v ./cmd/toml-test"
}
]
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/toml-lang/toml-test
go 1.18

require (
github.com/BurntSushi/toml v1.3.3-0.20231207130039-4223137ff1f9
github.com/BurntSushi/toml v1.3.3-0.20240103001115-0e879cbdab10
// no_term branch, which doesn't depend on x/term and x/sys
zgo.at/zli v0.0.0-20231011155724-865ee344d4b3
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/BurntSushi/toml v1.3.3-0.20231207130039-4223137ff1f9 h1:lcDxyXwPxaYMIsFHL6UR/fzQouvVdaKpZh8zZRN+KlA=
github.com/BurntSushi/toml v1.3.3-0.20231207130039-4223137ff1f9/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/toml v1.3.3-0.20240103001115-0e879cbdab10 h1:HfOzWIEwtJGprgjAGJdf0WSvoTaSU+tb4nIjGn4SKlA=
github.com/BurntSushi/toml v1.3.3-0.20240103001115-0e879cbdab10/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
zgo.at/zli v0.0.0-20231011155724-865ee344d4b3 h1:c6mOqJByLZGs0hmCK0Pr+XuDU6XoNcccUROX/8nPP6g=
zgo.at/zli v0.0.0-20231011155724-865ee344d4b3/go.mod h1:HLAc12TjNGT+VRXr76JnsNE3pbooQtwKWhX+RlDjQ2Y=
18 changes: 10 additions & 8 deletions toml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,7 @@ func TestSize(t *testing.T) {
if err != nil {
return err
}

inf, err := d.Info()
if err != nil {
return err
}
if inf.IsDir() {
if d.IsDir() {
return nil
}
if strings.Contains(path, "/spec-") || strings.Contains(path, "/spec/") {
Expand All @@ -138,8 +133,15 @@ func TestSize(t *testing.T) {
return nil
}

if inf.Size() > 1024 {
t.Errorf("larger than 1K: %s (%fK)", path, float64(inf.Size())/1024)
// Don't use FileInfo.Size() as that reports inconsistent results on
// different platforms.
data, err := fs.ReadFile(EmbeddedTests(), path)
if err != nil {
return err
}
if l := len(data); l > 1024 {
data, _ := fs.ReadFile(EmbeddedTests(), path)
t.Errorf("larger than 1K: %s (%fK)\n%v", path, float64(l)/1024, data)
}
return nil
})
Expand Down
Loading