diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 6d4c2ec7a..3026154a5 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -120,6 +120,21 @@ jobs: PKG_NAME=$(awk -F- '{ print $1 }' <<< $package) PKG_VERSION=$(awk -F- '{ print $2 }' <<< $package) + # Read limit_overrides from metadata.json + COMPILE_TIMEOUT=$(jq -r '.limit_overrides.compile_timeout // empty' packages/$PKG_PATH/metadata.json) + COMPILE_TIMEOUT_FLAG="" + if [ -n "$COMPILE_TIMEOUT" ]; then + COMPILE_TIMEOUT_FLAG="-c $COMPILE_TIMEOUT" + echo "Using compile_timeout: $COMPILE_TIMEOUT" + fi + + RUN_TIMEOUT=$(jq -r '.limit_overrides.run_timeout // empty' packages/$PKG_PATH/metadata.json) + RUN_TIMEOUT_FLAG="" + if [ -n "$RUN_TIMEOUT" ]; then + RUN_TIMEOUT_FLAG="-r $RUN_TIMEOUT" + echo "Using run_timeout: $RUN_TIMEOUT" + fi + echo "Installing..." docker run --network container:api appropriate/curl -sXPOST http://localhost:2000/api/v2/packages -H "Content-Type: application/json" -d "{\"language\":\"$PKG_NAME\",\"version\":\"$PKG_VERSION\"}" @@ -130,7 +145,7 @@ jobs: do TEST_RUNTIME=$(awk -F. '{print $2}' <<< $(basename $tscript)) echo Running $tscript with runtime=$TEST_RUNTIME - docker run --network container:api -v "$PWD/cli:/app" -v "$PWD/$(dirname $tscript):/pkg" node:15 /app/index.js run $TEST_RUNTIME -l $PKG_VERSION /pkg/$(basename $tscript) > test_output + docker run --network container:api -v "$PWD/cli:/app" -v "$PWD/$(dirname $tscript):/pkg" node:15 /app/index.js run $TEST_RUNTIME -l $PKG_VERSION $COMPILE_TIMEOUT_FLAG $RUN_TIMEOUT_FLAG /pkg/$(basename $tscript) > test_output cat test_output grep "OK" test_output done diff --git a/packages/go/1.25.5/build.sh b/packages/go/1.25.5/build.sh new file mode 100755 index 000000000..3b08351c5 --- /dev/null +++ b/packages/go/1.25.5/build.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +curl -LO https://go.dev/dl/go1.25.5.linux-amd64.tar.gz +tar -xzf go1.25.5.linux-amd64.tar.gz +rm go1.25.5.linux-amd64.tar.gz diff --git a/packages/go/1.25.5/compile b/packages/go/1.25.5/compile new file mode 100644 index 000000000..cbff042fa --- /dev/null +++ b/packages/go/1.25.5/compile @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +mv $1 $1.go +GOCACHE=$PWD go build -o binary *.go +chmod +x binary diff --git a/packages/go/1.25.5/environment b/packages/go/1.25.5/environment new file mode 100644 index 000000000..88299c1ad --- /dev/null +++ b/packages/go/1.25.5/environment @@ -0,0 +1,2 @@ +export PATH=$PWD/go/bin:$PATH +export GOPATH=$PWD/gopath diff --git a/packages/go/1.25.5/metadata.json b/packages/go/1.25.5/metadata.json new file mode 100644 index 000000000..3ed1ffd56 --- /dev/null +++ b/packages/go/1.25.5/metadata.json @@ -0,0 +1,10 @@ +{ + "language": "go", + "version": "1.25.5", + "aliases": ["go", "golang"], + "limit_overrides": { + "compile_timeout": 15000, + "compile_cpu_time": 15000, + "max_file_size": 50000000 + } +} diff --git a/packages/go/1.25.5/run b/packages/go/1.25.5/run new file mode 100755 index 000000000..d377dd939 --- /dev/null +++ b/packages/go/1.25.5/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +shift +./binary "$@" diff --git a/packages/go/1.25.5/test.go b/packages/go/1.25.5/test.go new file mode 100644 index 000000000..c06f48560 --- /dev/null +++ b/packages/go/1.25.5/test.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("OK") +}