|
|
@ -8,13 +8,18 @@ on:
|
|
|
|
types: [opened, synchronize]
|
|
|
|
types: [opened, synchronize]
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
|
|
|
|
|
|
|
|
avoid_reduncy:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
- name: Cancel Previous Redundant Builds
|
|
|
|
- name: Cancel Previous Redundant Builds
|
|
|
|
uses: styfle/cancel-workflow-action@0.9.1
|
|
|
|
uses: styfle/cancel-workflow-action@0.9.1
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
access_token: ${{ github.token }}
|
|
|
|
access_token: ${{ github.token }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lint:
|
|
|
|
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
fetch-depth: 0
|
|
|
@ -25,16 +30,74 @@ jobs:
|
|
|
|
run: npm ci
|
|
|
|
run: npm ci
|
|
|
|
- name: Lint
|
|
|
|
- name: Lint
|
|
|
|
run: npm run eslint
|
|
|
|
run: npm run eslint
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
node-version: '14'
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
|
|
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
|
|
- name: Build
|
|
|
|
run: npm run build
|
|
|
|
run: npm run build
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
name: dist
|
|
|
|
|
|
|
|
path: dist
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test:
|
|
|
|
|
|
|
|
needs: [lint, build]
|
|
|
|
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
node-version: '14'
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
name: dist
|
|
|
|
|
|
|
|
path: dist
|
|
|
|
- name: Test
|
|
|
|
- name: Test
|
|
|
|
run: npm test
|
|
|
|
run: npm test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
e2e:
|
|
|
|
|
|
|
|
needs: [lint, build]
|
|
|
|
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
node-version: '14'
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
name: dist
|
|
|
|
|
|
|
|
path: dist
|
|
|
|
- name: E2E tests
|
|
|
|
- name: E2E tests
|
|
|
|
uses: cypress-io/github-action@v2
|
|
|
|
uses: cypress-io/github-action@v2
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
command: npm run test:e2e
|
|
|
|
command: npm run test:e2e
|
|
|
|
start: npm run start-test
|
|
|
|
start: npm run start-test
|
|
|
|
wait-on: http://localhost:5000
|
|
|
|
wait-on: http://localhost:5000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
|
|
|
|
needs: [tests, e2e]
|
|
|
|
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Deploy to Heroku
|
|
|
|
- name: Deploy to Heroku
|
|
|
|
if: ${{ github.event_name == 'push' }}
|
|
|
|
if: ${{ github.event_name == 'push' }}
|
|
|
|
uses: akhileshns/heroku-deploy@v3.12.12
|
|
|
|
uses: akhileshns/heroku-deploy@v3.12.12
|
|
|
|