Skip to content
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
17 changes: 16 additions & 1 deletion .github/workflows/package-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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\"}"

Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions packages/go/1.25.5/build.sh
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions packages/go/1.25.5/compile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

mv $1 $1.go
GOCACHE=$PWD go build -o binary *.go
chmod +x binary
2 changes: 2 additions & 0 deletions packages/go/1.25.5/environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export PATH=$PWD/go/bin:$PATH
export GOPATH=$PWD/gopath
10 changes: 10 additions & 0 deletions packages/go/1.25.5/metadata.json
Original file line number Diff line number Diff line change
@@ -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
}
}
4 changes: 4 additions & 0 deletions packages/go/1.25.5/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

shift
./binary "$@"
7 changes: 7 additions & 0 deletions packages/go/1.25.5/test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "fmt"

func main() {
fmt.Println("OK")
}
Loading