Skip to content

Commit

Permalink
Merge pull request #417 from online-judge-tools/fix/verify-csharp-go
Browse files Browse the repository at this point in the history
Update C# and Go
  • Loading branch information
koba-e964 committed Aug 12, 2023
2 parents 4ee2172 + 7025a38 commit 9c63767
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ jobs:
# required only if you want to verify C# script files
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '3.1.101'
dotnet-version: '6.0.413'
- name: Install dependencies (C#)
run: dotnet tool install --global dotnet-script --version 1.4.0
run: dotnet tool install --global dotnet-script --version 1.3.0

# required only if you want to verify Go code
- name: Install dependencies (Go)
uses: actions/setup-go@v4
with:
go-version: '1.20.7'

# required only if you want to verify Ruby code
- name: Install dependencies (Ruby)
Expand Down
8 changes: 8 additions & 0 deletions .verify-helper/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ compile = "bash -c 'echo hello > {tempdir}/hello'"
execute = "env AWKPATH={basedir} awk -f {path}"
bundle = "false"
list_dependencies = "sed 's/^@include \"\\(.*\\)\"$/\\1/ ; t ; d' {path}"

[languages.go]
# Because of Go modules, go run does not work outside a module.
# With -C option, go run changes directory and executes otherwise normally.
# We need to add the prefix ../../ because {path} is something like examples/go/helloworld.test.go
# and the argument is interpreted relative to ./examples/go.
# -C option is available in Go >=1.20.
execute = "go run -C ./examples/go ../../{path}"
3 changes: 3 additions & 0 deletions examples/go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module example-go

go 1.20
6 changes: 3 additions & 3 deletions examples/go/helloworld.test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
package main

import (
"fmt"
"./helloworld"
"example-go/helloworld"
"fmt"
)

func main() {
fmt.Printf("%s\n", helloworld.GetHelloWorld())
fmt.Printf("%s\n", helloworld.GetHelloWorld())
}

0 comments on commit 9c63767

Please sign in to comment.