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: fix Go version matrix, and drop go 1.12, add go 1.15 #19

Merged
merged 2 commits into from
Nov 1, 2020

Conversation

thaJeztah
Copy link
Member

No description provided.

@thaJeztah
Copy link
Member Author

@dims @cpuguy83 PTAL

@thaJeztah
Copy link
Member Author

I think something is wrong in how CI is setup; see #21 - looks like may not be testing different Go versions?

the matrix used "go-versions", but it was later referenced
as "matrix.go-version", which may have been the cause we
did not install multiple versions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

Okay; that looks better;

Before:

Screenshot 2020-10-31 at 15 40 27

After:

Screenshot 2020-10-31 at 15 41 55

@thaJeztah thaJeztah changed the title CI: drop go 1.12, add go 1.15 CI: fix Go version matrix, and drop go 1.12, add go 1.15 Oct 31, 2020
@thaJeztah
Copy link
Member Author

@AkihiroSuda PTAL

we may have to check other repositories as well, in case the same bug is present there 😓

with:
go-version: ${{ matrix.go-version }}
go-version: ${{ matrix.go }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this line?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it isgo-versions in line 7 and go-version here, so it didn't work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, so here's why I renamed (and why it was somewhat easy to overlook the problem);

Originally, the matrix looked like (simplified);

strategy:
  matrix:
    go-versions: [1.12.x, 1.13.x, 1.14.x]
steps:
- name: Install Go
  uses: actions/setup-go@v1
  with:
    go-version: ${{ matrix.go-version }}

I haven't done a lot with GH Actions yet, so when reading the above, I made the incorrect assumption that was how GH actions handled matrix values;

  • matrix -> go-versions being plural (because it's a list), and
  • with -> go-version singular, because it gets assigned a value from the matrix.

Clearly, I was wrong there (and the with: value must have the same name as the value in the matrix:).

When looking for the problem, I went to the GitHub repo of the action; https://github.com/actions/setup-go/blob/v2.1.3/README.md#usage. Comparing those examples with what we had;

  • Perhaps it was because we didn't explicitly add quotes around the values in the 1.12.x (recalling the dreaded YAML time issue docker/compose#103 issue when specifying port-mappings in compose)
  • Perhaps it didn't support the .x suffixes? (planning on opening a ticket or PR in that repository to add a section explaining what formats are accepted)
  • Perhaps it was a bug in v1, fixed in v2?
  • Perhaps it was the name (go-versions versus go)?

And that's when I found the difference (plural versus singular).

Copy link
Member Author

@thaJeztah thaJeztah Nov 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AkihiroSuda I can rename to go-version if you prefer; I used go (as in the example) because I thought it was less likely for someone to rename go to gos (plural), and re-introduce the bug, but I'm not really attached to the name

@thaJeztah
Copy link
Member Author

Opened actions/setup-go#82 and actions/setup-go#83 enhancement requests for the GitHub action

@AkihiroSuda AkihiroSuda merged commit 0c0b3e1 into moby:master Nov 1, 2020
@thaJeztah thaJeztah deleted the bump_go_versions branch November 1, 2020 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants