Skip to content

Commit

Permalink
fix that CI go:embed test forever, again (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp authored Aug 13, 2021
1 parent f16058d commit ebccd50
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 53 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,13 @@ jobs:
- run: go test -v -run TestRaceyPatternSchema -race ./...
env:
CGO_ENABLED: '1'
run: git --no-pager diff && [[ $(git --no-pager diff --name-only | wc -l) = 0 ]]
- run: |
cd openapi3/testdata
go get -u -v github.com/getkin/kin-openapi
go test -tags with_embed ./...
git --no-pager diff && git checkout -- .
cd -
cp openapi3/testdata/load_with_go_embed_test.go openapi3/
cat go.mod | sed 's%go 1.14%go 1.16%' >gomod && mv gomod go.mod
go test ./...
if: matrix.go != '1.14'
- if: runner.os == 'Linux'
run: git --no-pager diff && [[ $(git --no-pager diff --name-only | wc -l) = 0 ]]


- if: runner.os == 'Linux'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@

# IntelliJ / GoLand
.idea

/openapi3/load_with_go_embed_test.go
5 changes: 0 additions & 5 deletions openapi3/testdata/go.mod

This file was deleted.

38 changes: 0 additions & 38 deletions openapi3/testdata/go.sum

This file was deleted.

6 changes: 2 additions & 4 deletions openapi3/testdata/load_with_go_embed_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//+build with_embed

package openapi3_test

import (
Expand All @@ -10,7 +8,7 @@ import (
"github.com/getkin/kin-openapi/openapi3"
)

//go:embed recursiveRef/*
//go:embed testdata/recursiveRef/*
var fs embed.FS

func Example() {
Expand All @@ -20,7 +18,7 @@ func Example() {
return fs.ReadFile(uri.Path)
}

doc, err := loader.LoadFromFile("recursiveRef/openapi.yml")
doc, err := loader.LoadFromFile("testdata/recursiveRef/openapi.yml")
if err != nil {
panic(err)
}
Expand Down

0 comments on commit ebccd50

Please sign in to comment.