2020-05-27 19:56:30 +01:00
|
|
|
name: CI
|
2020-05-26 20:44:36 +01:00
|
|
|
on:
|
|
|
|
push:
|
2020-07-28 21:13:48 +01:00
|
|
|
branches:
|
|
|
|
- master
|
2020-09-25 22:44:15 +01:00
|
|
|
- hotfix/**
|
|
|
|
- release/**
|
2020-05-26 20:44:36 +01:00
|
|
|
pull_request:
|
2020-07-28 21:13:48 +01:00
|
|
|
branches:
|
|
|
|
- master
|
2020-05-26 20:44:36 +01:00
|
|
|
jobs:
|
2020-06-15 16:08:54 +01:00
|
|
|
compile:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: "Compile TypeScript"
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 12.x
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- run: npm ci
|
|
|
|
- run: npm run compile
|
|
|
|
- run: npm run compile:strict
|
|
|
|
format:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: "Check Format"
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 12.x
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- run: npm ci
|
|
|
|
- run: npm run format:check
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: "Lint"
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 12.x
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- run: npm ci
|
|
|
|
- run: npm run lint
|
2020-06-15 17:25:59 +01:00
|
|
|
unittest:
|
2020-05-26 20:44:36 +01:00
|
|
|
runs-on: ubuntu-latest
|
2020-05-27 19:56:30 +01:00
|
|
|
name: "Unit Tests"
|
2020-05-26 20:44:36 +01:00
|
|
|
steps:
|
2020-05-27 19:56:30 +01:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 12.x
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- run: npm ci
|
|
|
|
- run: npm run test
|
2020-05-26 20:44:36 +01:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2020-07-27 18:58:27 +01:00
|
|
|
needs: [lint, format, compile, unittest]
|
2020-05-27 19:56:30 +01:00
|
|
|
name: "Build"
|
2020-05-26 20:44:36 +01:00
|
|
|
steps:
|
2020-05-27 19:56:30 +01:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 12.x
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- run: npm ci
|
2020-05-30 02:14:09 +01:00
|
|
|
- run: npm run build:contracts
|
|
|
|
- name: Restore Build Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: .cache
|
|
|
|
key: ${{ runner.os }}-build-cache
|
|
|
|
- run: npm run pack:prod
|
2020-06-12 18:33:00 +01:00
|
|
|
- run: cp -r ./Contracts ./dist/contracts
|
2020-06-30 19:49:14 +01:00
|
|
|
- run: cp -r ./configs ./dist/configs
|
2020-05-30 02:14:09 +01:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: dist
|
|
|
|
path: dist/
|
2020-06-15 17:25:59 +01:00
|
|
|
endtoendemulator:
|
2020-11-13 16:58:38 +00:00
|
|
|
name: "End To End Emulator Tests"
|
2020-07-27 18:58:27 +01:00
|
|
|
needs: [lint, format, compile, unittest]
|
2020-05-27 19:56:30 +01:00
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 12.x
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
2020-11-13 16:58:38 +00:00
|
|
|
- uses: southpolesteve/cosmos-emulator-github-action@v1
|
2020-05-27 19:56:30 +01:00
|
|
|
- name: End to End Tests
|
|
|
|
run: |
|
|
|
|
npm ci
|
|
|
|
npm start &
|
2020-11-13 16:58:38 +00:00
|
|
|
npm run wait-for-server
|
|
|
|
npx jest -c ./jest.config.e2e.js --detectOpenHandles sql
|
2020-05-27 19:56:30 +01:00
|
|
|
shell: bash
|
|
|
|
env:
|
2020-11-13 16:58:38 +00:00
|
|
|
DATA_EXPLORER_ENDPOINT: "https://localhost:1234/explorer.html?platform=Emulator"
|
|
|
|
PLATFORM: "Emulator"
|
2020-05-27 19:56:30 +01:00
|
|
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
2020-11-13 16:58:38 +00:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: screenshots
|
|
|
|
path: failed-*
|
2020-07-15 05:01:28 +01:00
|
|
|
accessibility:
|
|
|
|
name: "Accessibility | Hosted"
|
2020-07-27 18:58:27 +01:00
|
|
|
needs: [lint, format, compile, unittest]
|
2020-07-15 05:01:28 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 12.x
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
- name: Accessibility Check
|
|
|
|
run: |
|
|
|
|
# Ubuntu gets mad when webpack runs too many files watchers
|
|
|
|
cat /proc/sys/fs/inotify/max_user_watches
|
|
|
|
sudo sysctl fs.inotify.max_user_watches=524288
|
|
|
|
sudo sysctl -p
|
|
|
|
npm ci
|
|
|
|
npm start &
|
2020-11-13 16:58:38 +00:00
|
|
|
npx wait-on -i 5000 https-get://0.0.0.0:1234/
|
2020-07-15 05:01:28 +01:00
|
|
|
node utils/accesibilityCheck.js
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
2020-11-13 16:58:38 +00:00
|
|
|
endtoendhosted:
|
|
|
|
name: "End to End Hosted Tests"
|
2020-09-30 21:42:33 +01:00
|
|
|
needs: [lint, format, compile, unittest]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 12.x
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
2020-11-13 16:58:38 +00:00
|
|
|
- name: End to End Hosted Tests
|
2020-09-30 21:42:33 +01:00
|
|
|
run: |
|
|
|
|
npm ci
|
|
|
|
npm start &
|
|
|
|
npm run wait-for-server
|
|
|
|
npm run test:e2e
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
2020-11-19 17:29:38 +00:00
|
|
|
PORTAL_RUNNER_SUBSCRIPTION: ${{ secrets.PORTAL_RUNNER_SUBSCRIPTION }}
|
|
|
|
PORTAL_RUNNER_RESOURCE_GROUP: ${{ secrets.PORTAL_RUNNER_RESOURCE_GROUP }}
|
|
|
|
PORTAL_RUNNER_DATABASE_ACCOUNT: ${{ secrets.PORTAL_RUNNER_DATABASE_ACCOUNT }}
|
|
|
|
PORTAL_RUNNER_DATABASE_ACCOUNT_KEY: ${{ secrets.PORTAL_RUNNER_DATABASE_ACCOUNT_KEY }}
|
|
|
|
NOTEBOOKS_TEST_RUNNER_TENANT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_TENANT_ID }}
|
|
|
|
NOTEBOOKS_TEST_RUNNER_CLIENT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_ID }}
|
|
|
|
NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET }}
|
2020-09-30 21:42:33 +01:00
|
|
|
PORTAL_RUNNER_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_SQL }}
|
|
|
|
MONGO_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_MONGO }}
|
|
|
|
CASSANDRA_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_CASSANDRA }}
|
2020-11-02 19:33:14 +00:00
|
|
|
TABLES_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_TABLE }}
|
2020-11-03 19:05:54 +00:00
|
|
|
DATA_EXPLORER_ENDPOINT: "https://localhost:1234/hostedExplorer.html"
|
2020-11-02 19:33:14 +00:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: screenshots
|
|
|
|
path: failed-*
|
2020-05-30 02:14:09 +01:00
|
|
|
nuget:
|
|
|
|
name: Publish Nuget
|
2020-07-28 21:13:48 +01:00
|
|
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
2020-11-13 16:58:38 +00:00
|
|
|
needs: [lint, format, compile, build, unittest, endtoendemulator, endtoendhosted]
|
2020-05-30 02:14:09 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
|
|
|
|
AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }}
|
|
|
|
steps:
|
|
|
|
- uses: nuget/setup-nuget@v1
|
|
|
|
with:
|
|
|
|
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
|
|
|
|
- name: Download Dist Folder
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: dist
|
2020-06-30 19:49:14 +01:00
|
|
|
- run: cp ./configs/prod.json config.json
|
2020-05-30 02:14:09 +01:00
|
|
|
- run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "GitHub" -Password "$AZURE_DEVOPS_PAT"
|
|
|
|
- run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}"
|
|
|
|
- run: nuget push -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg
|
|
|
|
- uses: actions/upload-artifact@v2
|
2020-07-02 15:58:36 +01:00
|
|
|
name: packages
|
2020-05-30 02:14:09 +01:00
|
|
|
with:
|
|
|
|
path: "*.nupkg"
|
|
|
|
nugetmpac:
|
|
|
|
name: Publish Nuget MPAC
|
2020-07-28 21:13:48 +01:00
|
|
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
2020-11-13 16:58:38 +00:00
|
|
|
needs: [lint, format, compile, build, unittest, endtoendemulator, endtoendhosted]
|
2020-05-30 02:14:09 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
|
|
|
|
AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }}
|
|
|
|
steps:
|
|
|
|
- uses: nuget/setup-nuget@v1
|
|
|
|
with:
|
|
|
|
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
|
|
|
|
- name: Download Dist Folder
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: dist
|
2020-06-30 19:49:14 +01:00
|
|
|
- run: cp ./configs/mpac.json config.json
|
2020-05-30 02:14:09 +01:00
|
|
|
- run: sed -i 's/Azure.Cosmos.DB.Data.Explorer/Azure.Cosmos.DB.Data.Explorer.MPAC/g' DataExplorer.nuspec
|
|
|
|
- run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "GitHub" -Password "$AZURE_DEVOPS_PAT"
|
|
|
|
- run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}"
|
|
|
|
- run: nuget push -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg
|
|
|
|
- uses: actions/upload-artifact@v2
|
2020-07-02 15:58:36 +01:00
|
|
|
name: packages
|
2020-05-30 02:14:09 +01:00
|
|
|
with:
|
|
|
|
path: "*.nupkg"
|