Compare commits

..

No commits in common. "a1aba52c3a152b3e69e10591e28a33edd9f7a65d" and "abec6cf2444e354d4df90c5570162481c3f6cecd" have entirely different histories.

10 changed files with 8 additions and 95 deletions

View file

@ -54,9 +54,6 @@ jobs:
- uses: actions/download-artifact@v2
with:
name: packages
- name: Relocate downloaded packages
run: mv *.pkg.tar.gz packages/
- name: Write test config file
uses: DamianReeves/write-file-action@v1.0
@ -74,67 +71,18 @@ jobs:
output_max_size: 1024
max_process_count: 64
max_open_files: 2048
repo_url: http://localhost:8000/index
repo_url: http://piston_fs_repo:8000/index
write-mode: overwrite
- name: Login to GitHub registry
uses: docker/login-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
- name: Run tests
run: |
ls -la
docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' -d --name piston_fs_repo docker.pkg.github.com/engineer-man/piston/repo-builder --no-build
docker run --network container:piston_fs_repo -v $(pwd)'/data:/piston' -d --name api docker.pkg.github.com/engineer-man/piston/api
docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' --name piston_fs_repo docker.pkg.github.com/engineer-man/piston/repo-builder $PACKAGES &
docker run -v $(pwd)'/data:/piston' --name api docker.pkg.github.com/engineer-man/piston/api &
echo Waiting for API to start..
docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:6969/runtimes
echo Waiting for Index to start..
docker run --network container:piston_fs_repo appropriate/curl -s --retry 10 --retry-connrefused http://localhost:8000/index
echo Adjusting index
sed -i 's/piston_fs_repo/localhost/g' repo/index
echo Listing Packages
PACKAGES_JSON=$(docker run --network container:api appropriate/curl -s http://localhost:6969/packages)
echo $PACKAGES_JSON
echo Getting CLI ready
docker run -v "$PWD/cli:/app" --entrypoint /bin/bash node:15 -c 'cd /app; yarn'
for package in $(jq -r '.[] | "\(.language)-\(.language_version)"' <<< "$PACKAGES_JSON")
do
echo "Testing $package"
PKG_PATH=$(sed 's|-|/|' <<< $package)
PKG_NAME=$(awk -F- '{ print $1 }' <<< $package)
PKG_VERSION=$(awk -F- '{ print $2 }' <<< $package)
echo "Installing..."
docker run --network container:api appropriate/curl -sXPOST http://localhost:6969/packages/$PKG_PATH
TEST_SCRIPTS=packages/$PKG_PATH/test.*
echo "Tests: $TEST_SCRIPTS"
for tscript in $TEST_SCRIPTS
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 $PKG_VERSION /pkg/$(basename $tscript) | grep OK
done
done
- name: Dump logs
if: ${{ always() }}
run: |
docker logs api
docker logs piston_fs_repo
while [[ "$(curl -s -w '%{http_code}' http://api:6969/runtimes)" != "200" ]]; do sleep 5; done
echo Testing packages

View file

@ -52,7 +52,7 @@ exports.handler = async function(argv){
language: argv.language,
version: argv['language-version'],
files: files,
main: path.basename(argv.file),
main: argv.file,
args: argv.args,
stdin,
compile_timeout: argv.ct,
@ -84,8 +84,6 @@ exports.handler = async function(argv){
chalk.bold.yellow(ctx.signal)
)
}
if(response.compile) step('Compile', response.compile)
step('Run', response.run)

View file

@ -1 +1 @@
export PATH=$PWD/bin:$PATH
export PATH=$PWD/php-8.0.2/bin:$PATH

View file

@ -1,19 +0,0 @@
#!/bin/bash
PREFIX=$(realpath $(dirname $0))
mkdir -p build
cd build
curl "https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.gz" -o ruby.tar.gz
tar xzf ruby.tar.gz --strip-components=1
rm ruby.tar.gz
./configure --prefix "$PREFIX"
make -j$(nproc)
make install -j$(nproc)
cd ..
rm -rf build

View file

@ -1 +0,0 @@
export PATH=$PWD/bin:$PATH

View file

@ -1,6 +0,0 @@
{
"language": "ruby",
"version": "2.5.1",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["ruby", "rb"]
}

View file

@ -1,3 +0,0 @@
#!/bin/bash
ruby $*

View file

@ -1 +0,0 @@
puts("OK")

View file

@ -28,12 +28,10 @@ do
elif [[ $CI -eq 1 ]]; then
echo "Commit SHA: $pkg"
cd ..
echo "Changed files:"
git diff --name-only $pkg^1 $pkg
PACKAGES=$(git diff --name-only $pkg^1 $pkg | awk -F/ '{ print $2 "-" $3 }' | sort -u)
cd packages
echo "Building packages: $PACKAGES"
for package in "$PACKAGES"; do
make -j16 $package.pkg.tar.gz

View file

@ -17,7 +17,6 @@ do
PKGCHECKSUM=$(sha256sum $PKGFILE | awk '{print $1}')
echo "$PKGNAME,$PKGVERSION,$PKGCHECKSUM,$BASEURL$PKGFILE" >> index
echo "Adding package $PKGNAME-$PKGVERSION"
((i=i+1))
done