Compare commits

..

No commits in common. "e82f019d0ec62a48d61eff1d31d64fbd1302d99c" and "b410fa8525f7fd13a3becb8f25c985c3de4235f2" have entirely different histories.

2 changed files with 4 additions and 5 deletions

View file

@ -49,9 +49,9 @@ jobs:
- name: Run tests - name: Run tests
run: | run: |
docker run -p 6969:6969 -v $(pwd)'/data:/piston' -v $(pwd)'/repo:/repo' --privileged --name api piston_api & docker run -dp 6969:6969 -v $(pwd)'/repo:/repo' --privileged --name api piston_api
echo Waiting for API to start.. echo Waiting for API to start..
while [[ "$(curl -s -w '%{http_code}' http://127.0.0.1:6969/runtimes)" != "200" ]]; do sleep 5; done bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:6969/runtimes)" != "200" ]]; do sleep 5; done'
echo Adding local repo echo Adding local repo
curl -s http://127.0.0.1:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml" curl -s http://127.0.0.1:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml"
echo Testing packages echo Testing packages
@ -65,8 +65,7 @@ jobs:
echo Testing ${PKG_SLUG} (using ${PKG_SLUG}.tf) echo Testing ${PKG_SLUG} (using ${PKG_SLUG}.tf)
TEST_FILE=$(cat ${PKG_SLUG}.tf) TEST_FILE=$(cat ${PKG_SLUG}.tf)
TEST_JSON=`jq -C '.language = "${PKG_NAME}" | .version = "${PKG_VERSION}" | .files=[] | .files[0]={} | .files[0].name="test" | .files[0].name.content="${TEST_FILE}" | .main = "test" | .args = [] | .stdin = "" | .compile_timeout = 10000 | .run_timeout = 3000' <<< '{}'` TEST_JSON=`jq -C '.language = "${PKG_NAME}" | .version = "${PKG_VERSION}" | .files=[] | .files[0]={} | .files[0].name="test" | .files[0].name.content="${TEST_FILE}" | .main = "test" | .args = [] | .stdin = "" | .compile_timeout = 10000 | .run_timeout = 3000' <<< '{}'`
curl -sXPOST http://127.0.0.1:6969/jobs -H 'Content-Type: application/json' -d "$TEST_JSON" > ${PKG_SLUG}.tr curl -sXPOST http://127.0.0.1:6969/jobs -H 'Content-Type: application/json' -d "$TEST_JSON"
jq '.run.stdout' ${PKG_SLUG}.tr | grep "OK" || exit 1
done done

View file

@ -7,4 +7,4 @@ done
cd /repo cd /repo
./mkindex.sh ./mkindex.sh
curl -s http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml" || echo "WARNING: Could not add repository" curl -s http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml"