name: 'Package Pull Requests' on: pull_request: types: - opened - edited - reopened - synchronize paths: - 'packages/**' jobs: check-build: name: Check that package builds runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Build docker containers run: | docker build -t piston_fs_repo repo - name: Build Packages run: | PACKAGES=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | awk -F/ '{ print $2 "-" $3 }' | sort -u) docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' piston_fs_repo $PACKAGES --no-server - name: Write test config file uses: DamianReeves/write-file-action@v1.0 with: path: data/config.yaml contents: | log_level: DEBUG bind_address: 0.0.0.0:6969 data_directory: /piston runner_uid_min: 1100 runner_uid_max: 1500 runner_gid_min: 1100 runner_gid_max: 1500 enable_unshare: false output_max_size: 1024 max_process_count: 64 max_open_files: 2048 repo_url: http://piston_fs_repo:8000/index write-mode: overwrite - name: Run tests run: | docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' --name piston_fs_repo piston_fs_repo $PACKAGES docker run -v $(pwd)'/data:/piston' -v $(pwd)'/repo:/repo' --privileged --name docker.pkg.github.com/engineer-man/piston/api piston_api & echo Waiting for API to start.. while [[ "$(curl -s -w '%{http_code}' http://api:6969/runtimes)" != "200" ]]; do sleep 5; done echo Testing packages