Skip to content

Commit

Permalink
Explicitly set up Go 1.13.1 in checks running on old runner images
Browse files Browse the repository at this point in the history
  • Loading branch information
henrymercer committed Nov 15, 2022
1 parent 1e2f8f0 commit 07b9db6
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/__analyze-ref-input.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .github/workflows/__go-custom-queries.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .github/workflows/__go-tracing-autobuilder.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .github/workflows/__go-tracing-custom-build-steps.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .github/workflows/__go-tracing-legacy-workflow.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .github/workflows/__ml-powered-queries.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .github/workflows/__multi-language-autodetect.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .github/workflows/__remote-config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .github/workflows/__unset-environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .github/workflows/__upload-ref-sha-input.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .github/workflows/__with-checkout-path.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions pr-checks/checks/go-custom-queries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ description: "Checks that Go works in conjunction with a config file specifying
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
steps:
- uses: actions/setup-go@v3
with:
go-version: "^1.13.1"
- uses: ./../action/init
with:
languages: go
Expand Down
3 changes: 0 additions & 3 deletions pr-checks/checks/go-tracing-autobuilder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ operatingSystems: ["ubuntu", "macos"]
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
steps:
- uses: actions/setup-go@v3
with:
go-version: "^1.13.1"
- uses: ./../action/init
with:
languages: go
Expand Down
3 changes: 0 additions & 3 deletions pr-checks/checks/go-tracing-custom-build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: "Go: tracing with custom build steps"
description: "Checks that Go tracing traces the build when using custom build steps"
operatingSystems: ["ubuntu", "macos"]
steps:
- uses: actions/setup-go@v3
with:
go-version: "^1.13.1"
- uses: ./../action/init
with:
languages: go
Expand Down
3 changes: 0 additions & 3 deletions pr-checks/checks/go-tracing-legacy-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ operatingSystems: ["ubuntu", "macos"]
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
steps:
- uses: actions/setup-go@v3
with:
go-version: "^1.13.1"
- uses: ./../action/init
with:
languages: go
Expand Down
35 changes: 23 additions & 12 deletions pr-checks/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ def writeHeader(checkStream):
with open(f"checks/{file}", 'r') as checkStream:
checkSpecification = yaml.load(checkStream)

matrix = []
for version in checkSpecification.get('versions', defaultTestVersions):
runnerImages = operatingSystemsForVersion(version)
if checkSpecification.get('operatingSystems', None):
runnerImages = [image for image in runnerImages for operatingSystem in checkSpecification['operatingSystems']
if image.startswith(operatingSystem)]

for runnerImage in runnerImages:
matrix.append({
'os': runnerImage,
'version': version
})

steps = [
{
'name': 'Check out repository',
Expand All @@ -72,20 +85,18 @@ def writeHeader(checkStream):
}
}
]
steps.extend(checkSpecification['steps'])

matrix = []
for version in checkSpecification.get('versions', defaultTestVersions):
runnerImages = operatingSystemsForVersion(version)
if checkSpecification.get('operatingSystems', None):
runnerImages = [image for image in runnerImages for operatingSystem in checkSpecification['operatingSystems']
if image.startswith(operatingSystem)]
if any(not isCompatibleWithLatestImages(m['version']) for m in matrix):
steps.append({
'name': 'Set up Go',
'if': "matrix.os == 'ubuntu-20.04' || matrix.os == 'windows-2019'",
'uses': 'actions/setup-go@v3',
'with': {
'go-version': '^1.13.1'
}
})

for runnerImage in runnerImages:
matrix.append({
'os': runnerImage,
'version': version
})
steps.extend(checkSpecification['steps'])

checkJob = {
'strategy': {
Expand Down

0 comments on commit 07b9db6

Please sign in to comment.