mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-20 20:16:26 +02:00
Compare commits
4 commits
b410fa8525
...
e82f019d0e
Author | SHA1 | Date | |
---|---|---|---|
|
e82f019d0e | ||
|
f85c430869 | ||
|
d86dc4bbb3 | ||
|
d295861a7d |
2 changed files with 5 additions and 4 deletions
7
.github/workflows/package-pr.yaml
vendored
7
.github/workflows/package-pr.yaml
vendored
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue