Skip to content

Commit 873c8b6

Browse files
authored
Add playground-api for runner (#632)
* Add playground-api for runner * set up proper iam scopes * setup paths-ignore
1 parent 39c7bd2 commit 873c8b6

File tree

12 files changed

+9855
-0
lines changed

12 files changed

+9855
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Deploy playground API"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- '.github/workflows/deploy-playground-api.yml'
8+
- 'playground-api/**'
9+
10+
concurrency: playground_api
11+
12+
jobs:
13+
deploy:
14+
name: "Build & deploy"
15+
runs-on: "ubuntu-latest"
16+
17+
steps:
18+
- name: "Checkout"
19+
uses: actions/checkout@v4
20+
21+
- name: "Install Node"
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: "20"
25+
26+
- name: "Install dependencies"
27+
working-directory: ./playground-api
28+
run: "npm ci"
29+
30+
- name: "Check"
31+
working-directory: ./playground-api
32+
run: "npm run check"
33+
34+
- name: "Deploy"
35+
working-directory: ./playground-api
36+
env:
37+
AWS_DEFAULT_REGION: "us-east-1"
38+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
39+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
40+
run: "npm run deploy"

.github/workflows/php.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ name: Tests
22
on:
33
push:
44
branches: [main]
5+
paths-ignore:
6+
- 'playground-runner/**'
7+
- 'playground-api/**'
58
pull_request:
69
branches: [main]
10+
paths-ignore:
11+
- 'playground-runner/**'
12+
- 'playground-api/**'
713
schedule:
814
- cron: 0 0 * * *
915

.github/workflows/phpstan-dev.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ name: PHPStan other versions
22
on:
33
push:
44
branches: [main]
5+
paths-ignore:
6+
- 'playground-runner/**'
7+
- 'playground-api/**'
58
pull_request:
69
branches: [main]
10+
paths-ignore:
11+
- 'playground-runner/**'
12+
- 'playground-api/**'
713
schedule:
814
- cron: 0 0 * * *
915
jobs:

playground-api/.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
"extends": [
3+
'eslint:recommended',
4+
'plugin:@typescript-eslint/recommended',
5+
'plugin:@typescript-eslint/stylistic',
6+
],
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"project": "tsconfig.json",
10+
"sourceType": "module"
11+
},
12+
"plugins": [
13+
"@typescript-eslint"
14+
],
15+
"root": true,
16+
"rules": {
17+
"no-prototype-builtins": "off",
18+
"@typescript-eslint/no-explicit-any": "off",
19+
'@typescript-eslint/ban-ts-comment': [
20+
'error',
21+
{'ts-ignore': 'allow-with-description'},
22+
],
23+
"indent": ["error", "tab"],
24+
"no-console": "error"
25+
}
26+
};

playground-api/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
/.build
3+
/.serverless

playground-api/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Notes
2+
3+
Endpoints:
4+
5+
* POST - https://gkyhj54sul.execute-api.us-east-1.amazonaws.com/prod/analyse
6+
* GET - https://gkyhj54sul.execute-api.us-east-1.amazonaws.com/prod/result
7+
* GET - https://gkyhj54sul.execute-api.us-east-1.amazonaws.com/prod/sample
8+
* GET - https://gkyhj54sul.execute-api.us-east-1.amazonaws.com/prod/legacyResult

playground-api/example.http

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
POST https://gkyhj54sul.execute-api.us-east-1.amazonaws.com/prod/analyse
2+
Content-Type: application/json
3+
4+
{
5+
"code": "<?php\nmodule_load_include('inc', 'node', 'node.admin');",
6+
"level": "9",
7+
"strictRules": false,
8+
"bleedingEdge": false,
9+
"treatPhpDocTypesAsCertain": true,
10+
"saveResult": true
11+
}
12+
13+
###
14+
15+

0 commit comments

Comments
 (0)