2021-02-28 03:58:02 +01:00
|
|
|
name: 'Package Pull Requests'
|
|
|
|
|
|
|
|
on:
|
2021-02-28 04:07:16 +01:00
|
|
|
pull_request:
|
2021-02-28 03:58:02 +01:00
|
|
|
types:
|
|
|
|
- opened
|
|
|
|
- edited
|
|
|
|
- reopened
|
|
|
|
- synchronize
|
|
|
|
paths:
|
|
|
|
- 'packages/**'
|
|
|
|
|
|
|
|
jobs:
|
2021-02-28 07:30:35 +01:00
|
|
|
check-build:
|
|
|
|
name: Check that package builds
|
2021-02-28 03:58:02 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-02-28 07:30:35 +01:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Build docker containers
|
|
|
|
run: |
|
|
|
|
docker build -t piston_fs_repo repo
|
|
|
|
|
|
|
|
- name: Build Packages
|
|
|
|
run: |
|
2021-03-14 00:34:54 +01:00
|
|
|
PACKAGES=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | awk -F/ '{ print $2 "-" $3 }' | sort -u)
|
|
|
|
docker run -v $(pwd)'/repo:/repo' -v $(pwd)'/packages:/packages' piston_fs_repo $PACKAGES --no-server
|
|
|
|
|
|
|
|
- name: Write test config file
|
2021-03-14 00:36:19 +01:00
|
|
|
uses: damianreeves/write-file-action
|
2021-03-14 00:34:54 +01:00
|
|
|
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
|
2021-02-28 07:30:35 +01:00
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
2021-03-14 00:34:54 +01:00
|
|
|
docker run -v $(pwd)'/repo:/repo' -v $(pwd)'/packages:/packages' --name piston_fs_repo piston_fs_repo $PACKAGES
|
|
|
|
docker run -v $(pwd)'/data:/piston' -v $(pwd)'/repo:/repo' --privileged --name api piston_api &
|
2021-02-28 07:30:35 +01:00
|
|
|
echo Waiting for API to start..
|
2021-03-14 00:34:54 +01:00
|
|
|
while [[ "$(curl -s -w '%{http_code}' http://api:6969/runtimes)" != "200" ]]; do sleep 5; done
|
|
|
|
|
2021-02-28 07:30:35 +01:00
|
|
|
echo Testing packages
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|