Compare commits

...

4 commits

Author SHA1 Message Date
Thomas Hobson
e82f019d0e
ci(package-pr): mount piston directory into api 2021-02-28 22:30:07 +13:00
Thomas Hobson
f85c430869
ci(package-pr): dont endlessly hang 2021-02-28 22:25:23 +13:00
Thomas Hobson
d86dc4bbb3
ci(package-pr): check OK is included in STDOUT 2021-02-28 22:20:23 +13:00
Thomas Hobson
d295861a7d
repo: dont error if we cannot access piston_api 2021-02-28 22:18:27 +13:00
2 changed files with 5 additions and 4 deletions

View file

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

View file

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