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

ci: run tests on Windows #31

Merged
merged 5 commits into from
Mar 11, 2023
Merged
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
10 changes: 7 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
- package-ecosystem: gomod
directory: /
schedule:
interval: "daily"
interval: daily
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
17 changes: 13 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,30 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 0 * * MON"
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ oldstable, stable ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version-file: go.mod
go-version: ${{ matrix.go }}

- name: Run tests
run: go test -race -coverprofile=coverage.out ./...
# do not use `=` to join flags and values, it won't work on Windows;
# see https://github.com/PowerShell/PowerShell/issues/6291 for details.
run: go test -v -race -shuffle on -coverprofile coverage.out ./...

- name: Upload coverage
uses: codecov/codecov-action@v3
Expand Down
6 changes: 3 additions & 3 deletions musttag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
)

func TestAnalyzer(t *testing.T) {
// NOTE(junk1tm): analysistest does not yet support modules
// (see https://github.com/golang/go/issues/37054 for details).
// So, to be able to run tests with external dependencies,
// NOTE(junk1tm): analysistest does not yet support modules;
// see https://github.com/golang/go/issues/37054 for details.
// To be able to run tests with external dependencies,
// we first need to write a GOPATH-like tree of stubs.
prepareTestFiles(t)
testPackages = []string{"tests", "builtins"}
Expand Down
56 changes: 28 additions & 28 deletions testdata/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@ import (
)

type User struct { /* want
"`User` should be annotated with the `json` tag as it is passed to `json.Marshal` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `json` tag as it is passed to `json.MarshalIndent` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `json` tag as it is passed to `json.Unmarshal` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `json` tag as it is passed to `json.Encoder.Encode` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `json` tag as it is passed to `json.Decoder.Decode` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `json` tag as it is passed to `json.Marshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `json` tag as it is passed to `json.MarshalIndent` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `json` tag as it is passed to `json.Unmarshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `json` tag as it is passed to `json.Encoder.Encode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `json` tag as it is passed to `json.Decoder.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"

"`User` should be annotated with the `xml` tag as it is passed to `xml.Marshal` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.MarshalIndent` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.Unmarshal` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.Encoder.Encode` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.Decoder.Decode` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.Encoder.EncodeElement` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.Decoder.DecodeElement` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.Marshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.MarshalIndent` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.Unmarshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.Encoder.Encode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.Decoder.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.Encoder.EncodeElement` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `xml` tag as it is passed to `xml.Decoder.DecodeElement` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"

"`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Marshal` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Unmarshal` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Encoder.Encode` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Decoder.Decode` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Marshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Unmarshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Encoder.Encode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `yaml` tag as it is passed to `yaml.v3.Decoder.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"

"`User` should be annotated with the `toml` tag as it is passed to `toml.Unmarshal` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `toml` tag as it is passed to `toml.Decode` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `toml` tag as it is passed to `toml.DecodeFS` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `toml` tag as it is passed to `toml.DecodeFile` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `toml` tag as it is passed to `toml.Encoder.Encode` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `toml` tag as it is passed to `toml.Decoder.Decode` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `toml` tag as it is passed to `toml.Unmarshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `toml` tag as it is passed to `toml.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `toml` tag as it is passed to `toml.DecodeFS` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `toml` tag as it is passed to `toml.DecodeFile` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `toml` tag as it is passed to `toml.Encoder.Encode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `toml` tag as it is passed to `toml.Decoder.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"

"`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.Decode` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.DecodeMetadata` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.WeakDecode` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.WeakDecodeMetadata` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.Decode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.DecodeMetadata` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.WeakDecode` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `mapstructure` tag as it is passed to `mapstructure.WeakDecodeMetadata` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"

"`User` should be annotated with the `custom` tag as it is passed to `custom.Marshal` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `custom` tag as it is passed to `custom.Unmarshal` at testdata/src/builtins/builtins.go"
"`User` should be annotated with the `custom` tag as it is passed to `custom.Marshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
"`User` should be annotated with the `custom` tag as it is passed to `custom.Unmarshal` at testdata(/|\\\\)src(/|\\\\)builtins(/|\\\\)builtins.go"
*/
Name string
Email string `json:"email" xml:"email" yaml:"email" toml:"email" mapstructure:"email" custom:"email"`
Expand Down