Skip to content

Commit

Permalink
Add playground-api for runner (#632)
Browse files Browse the repository at this point in the history
* Add playground-api for runner

* set up proper iam scopes

* setup paths-ignore
  • Loading branch information
mglaman authored Nov 10, 2023
1 parent 39c7bd2 commit 873c8b6
Show file tree
Hide file tree
Showing 12 changed files with 9,855 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/deploy-playground-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Deploy playground API"
on:
push:
branches:
- main
paths:
- '.github/workflows/deploy-playground-api.yml'
- 'playground-api/**'

concurrency: playground_api

jobs:
deploy:
name: "Build & deploy"
runs-on: "ubuntu-latest"

steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Install Node"
uses: actions/setup-node@v4
with:
node-version: "20"

- name: "Install dependencies"
working-directory: ./playground-api
run: "npm ci"

- name: "Check"
working-directory: ./playground-api
run: "npm run check"

- name: "Deploy"
working-directory: ./playground-api
env:
AWS_DEFAULT_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: "npm run deploy"
6 changes: 6 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ name: Tests
on:
push:
branches: [main]
paths-ignore:
- 'playground-runner/**'
- 'playground-api/**'
pull_request:
branches: [main]
paths-ignore:
- 'playground-runner/**'
- 'playground-api/**'
schedule:
- cron: 0 0 * * *

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/phpstan-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ name: PHPStan other versions
on:
push:
branches: [main]
paths-ignore:
- 'playground-runner/**'
- 'playground-api/**'
pull_request:
branches: [main]
paths-ignore:
- 'playground-runner/**'
- 'playground-api/**'
schedule:
- cron: 0 0 * * *
jobs:
Expand Down
26 changes: 26 additions & 0 deletions playground-api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
"extends": [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic',
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"root": true,
"rules": {
"no-prototype-builtins": "off",
"@typescript-eslint/no-explicit-any": "off",
'@typescript-eslint/ban-ts-comment': [
'error',
{'ts-ignore': 'allow-with-description'},
],
"indent": ["error", "tab"],
"no-console": "error"
}
};
3 changes: 3 additions & 0 deletions playground-api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
/.build
/.serverless
8 changes: 8 additions & 0 deletions playground-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Notes

Endpoints:

* POST - https://gkyhj54sul.execute-api.us-east-1.amazonaws.com/prod/analyse
* GET - https://gkyhj54sul.execute-api.us-east-1.amazonaws.com/prod/result
* GET - https://gkyhj54sul.execute-api.us-east-1.amazonaws.com/prod/sample
* GET - https://gkyhj54sul.execute-api.us-east-1.amazonaws.com/prod/legacyResult
15 changes: 15 additions & 0 deletions playground-api/example.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
POST https://gkyhj54sul.execute-api.us-east-1.amazonaws.com/prod/analyse
Content-Type: application/json

{
"code": "<?php\nmodule_load_include('inc', 'node', 'node.admin');",
"level": "9",
"strictRules": false,
"bleedingEdge": false,
"treatPhpDocTypesAsCertain": true,
"saveResult": true
}

###


Loading

0 comments on commit 873c8b6

Please sign in to comment.