Erez Rokah 7e8084be87 chore: add proxy backend (#3126)
* feat(backends): add proxy backend

* feat: add proxy server initial commit

* fix: move from joi to @hapi/joi

* test: add joi validation tests

* feat: proxy server initial implementations

* test: add tests, fix build

* chore: update yarn.lock

* build: fix develop command

* fix(back-proxy): fix bugs

* test(backend-proxy): add cypress tests

* chore: cleanup

* chore: support node 10

* chore: code cleanup

* chore: run cypress on ubuntu 16.04

* test(e2e): fix proxy backend cypress tests

* chore: don't start proxy server on yarn develop
2020-01-22 16:47:34 -05:00

129 lines
3.6 KiB
YAML

name: Node CI
on:
push:
branches:
- master
tags:
- '*'
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v1
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
restore-keys: |
${{ runner.os }}-yarn-
- name: update yarn to latest version
run: |
sudo apt update && sudo apt install yarn
- name: npm install, unit test and build
run: |
node --version
npm --version
yarn --version
yarn --frozen-lockfile
yarn bootstrap
yarn test:ci
yarn build:demo
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096
- uses: actions/upload-artifact@master
with:
name: dev-test-website-node-${{ matrix.node-version }}
path: dev-test
# non forked workflow (has access to build secrets)
e2e-with-cypress-record:
needs: build
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false)
runs-on: ubuntu-16.04
strategy:
matrix:
machine: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- uses: actions/checkout@v1
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- uses: actions/cache@v1
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/download-artifact@master
with:
name: dev-test-website-node-10.x
path: dev-test
- name: update yarn to latest version
run: |
sudo apt update && sudo apt install yarn
- name: npm install and e2e test
run: |
node --version
npm --version
yarn --version
yarn --frozen-lockfile
yarn test:e2e:run-ci
env:
CI: true
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
NODE_OPTIONS: --max-old-space-size=4096
# forked workflow (no access to build secrets)
e2e-no-cypress-record:
needs: build
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- uses: actions/cache@v1
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/download-artifact@master
with:
name: dev-test-website-node-10.x
path: dev-test
- name: update yarn to latest version
run: |
sudo apt update && sudo apt install yarn
- name: npm install and e2e test
run: |
node --version
npm --version
yarn --version
yarn --frozen-lockfile
yarn test:e2e:run
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096