Skip to content

Commit

Permalink
Add superlinter (#134)
Browse files Browse the repository at this point in the history
This PR includes updates needed to make the linting pass.

Closes #133
  • Loading branch information
SeanTAllen authored Sep 16, 2023
1 parent 04c49db commit b5d72a2
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 40 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/docker-image-builds.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PR

on: pull_request

concurrency:
group: pr-${{ github.ref }}
cancel-in-progress: true

jobs:
superlinter:
name: Lint bash, docker, markdown, and yaml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint codebase
uses: docker://github/super-linter:v3.8.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: true
VALIDATE_BASH: true
VALIDATE_DOCKERFILE: true
VALIDATE_MD: true
VALIDATE_YAML: true

validate-docker-image-builds:
name: Validate Docker image builds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker build
run: "docker build --pull docker/."
32 changes: 16 additions & 16 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## From Ubuntu 18.04

```
```bash
# let's update first
sudo apt-get update

Expand All @@ -25,11 +25,11 @@ sudo pip install pygments

### Install Docker

See https://docs.docker.com/engine/install/ubuntu/
See the [Docker installation directions](https://docs.docker.com/engine/install/ubuntu/).

It boils down to:

```
```bash
# cleanup old stuff
sudo apt-get remove docker docker-engine docker.io containerd runc

Expand All @@ -49,15 +49,15 @@ sudo apt-get install -y docker-ce docker-ce-cli containerd.io

### Webserver setup

```
```bash
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install -y nginx python-certbot-nginx
```

Create /etc/nginx/sites-enabled/playground.ponylang.io.conf

```
```text
server {
listen 80 default_server;
listen [::]:80 default_server;
Expand All @@ -70,7 +70,7 @@ server {
}
```

```
```bash
rm /etc/nginx/sites-enabled/default
ln -sf /etc/nginx/sites-available/playground.ponylang.io.conf /etc/nginx/sites-enabled/playground.ponylang.io.conf

Expand All @@ -79,27 +79,27 @@ nginx -t && nginx -s reload

### SSL setup

```
```bash
certbot --nginx -d playground.ponylang.io -m [email protected]
```

crontab -e

```
```text
0 12 * * * /usr/bin/certbot renew --quiet
05 12 * * * systemctl restart playground
```

### Start docker

```
```bash
systemctl enable docker
systemctl start docker
```

### Install rust

```
```bash
curl https://sh.rustup.rs | sh
```

Expand All @@ -108,15 +108,15 @@ select `1` from prompt

As this file might be outdated, make sure the version here corresponds to the version listed in the `rust-toolchain` file of this repo.

```
```bash
source /root/.profile
rustup install 1.60.0
rustup default 1.60.0
```

### Build playground image

```
```bash
git clone https://github.com/ponylang/pony-playground.git
cd pony-playground
docker build docker --pull -t ponylang-playpen
Expand All @@ -131,15 +131,15 @@ Should ONLY be the token, not "user:token"

### Build it

```
```bash
cargo build --release --bin playpen
```

### Create Systemd Unit

Put the following in the file `/etc/systemd/system/playground.service`, put in the generated GITHUB_TOKEN from above:

```
```text
[Unit]
Description=Pony Playground Systemd Service Unit
Requires=docker.service
Expand All @@ -156,14 +156,14 @@ WantedBy=multi-user.target

### Enable and Run it

```
```bash
systemctl enable playground
systemctl start playground
```

STDOUT and STDERR both go the journal. If you want to investigate logs, use:

```
```bashP
journalctl -u playground ...
```

17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Pony Playground

A web interface for running Pony code.

Heavily based upon the [rust playpen](https://github.com/rust-lang/rust-playpen).
Expand All @@ -17,26 +19,25 @@ See [INSTALL.md](INSTALL.md) for installation instructions for a real box.

First, create the Docker image that playpen will use:

```
```bash
docker build docker -t ponylang-playpen
```

Get a github personal access token. Only the `gist` scope needs to be selected.
Put it into the `GITHUB_TOKEN` environment variable.
Get a github personal access token. Only the `gist` scope needs to be selected.
Put it into the `GITHUB_TOKEN` environment variable.

```
```text
export GITHUB_TOKEN="..."
```

It will be used for creating gists with the playgrounds contents.
If you want to test without a valid token, really all you need to do
If you want to test without a valid token, really all you need to do
is to set the variable to some gibberish.

Next, spin up the server.

```
```bash
cargo run --bin playpen
```

You should now be able to browse http://127.0.0.1:8000 and play.

You should now be able to browse [localhost on port 8000](http://127.0.0.1:8000) and play.

0 comments on commit b5d72a2

Please sign in to comment.