mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-26 15:37:02 +00:00
3fe63e88cb
* Adds e2e baseline SQL test in puppeteer * fix lint * Skip index test * add to ci * Stop waiting for server * Switch to headless mode * Adds wait-for-server to package.json and uses it in puppeteer CI * Adds waiton * top level wait on * Adds env var to secrets ci.yml * use existing connection string * redo tests * nits and hopefully fix timeout issue * Fix config file * try waiting for delete container menu * Removes statuseval * Remove unused var * Slow down and add quotes to selector * Fix blocking point, remove wait * Reduce to 50 * Adds database delete stuff * remove logs, add back waitFors * Finish container SQL spec test
268 lines
8.3 KiB
YAML
268 lines
8.3 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- hotfix/*
|
|
- release/*
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
jobs:
|
|
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
|
|
unittest:
|
|
runs-on: ubuntu-latest
|
|
name: "Unit Tests"
|
|
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 test
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: [lint, format, compile, unittest]
|
|
name: "Build"
|
|
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 build:contracts
|
|
- name: Restore Build Cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: .cache
|
|
key: ${{ runner.os }}-build-cache
|
|
- run: npm run pack:prod
|
|
- run: cp -r ./Contracts ./dist/contracts
|
|
- run: cp -r ./configs ./dist/configs
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: dist
|
|
path: dist/
|
|
endtoendemulator:
|
|
name: "End To End Tests | Emulator | SQL"
|
|
needs: [lint, format, compile, unittest]
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: southpolesteve/cosmos-emulator-github-action@v1
|
|
- name: Use Node.js 12.x
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 12.x
|
|
- name: Restore Cypress Binary Cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cache/Cypress
|
|
key: ${{ runner.os }}-cypress-binary-cache
|
|
- name: End to End Tests
|
|
run: |
|
|
npm ci
|
|
npm start &
|
|
npm ci --prefix ./cypress
|
|
npm run test:ci --prefix ./cypress -- --spec ./integration/dataexplorer/ci-tests/createDatabase.spec.ts
|
|
shell: bash
|
|
env:
|
|
EMULATOR_ENDPOINT: https://0.0.0.0:8081/
|
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
|
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
|
|
endtoendsql:
|
|
name: "End To End Tests | SQL"
|
|
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
|
|
- name: Restore Cypress Binary Cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cache/Cypress
|
|
key: ${{ runner.os }}-cypress-binary-cache
|
|
- run: npm ci
|
|
- name: End to End Tests
|
|
run: |
|
|
npm start &
|
|
cd cypress
|
|
npm ci
|
|
node cleanup.js
|
|
npm run wait-for-server
|
|
npx cypress run --browser chrome --headless --spec "./integration/dataexplorer/SQL/*"
|
|
shell: bash
|
|
env:
|
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
|
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
|
|
CYPRESS_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_SQL }}
|
|
- uses: actions/upload-artifact@v2
|
|
name: videos
|
|
if: ${{ failure() }}
|
|
with:
|
|
path: "**/*.mp4"
|
|
endtoendmongo:
|
|
name: "End To End Tests | Mongo"
|
|
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
|
|
- name: Restore Cypress Binary Cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cache/Cypress
|
|
key: ${{ runner.os }}-cypress-binary-cache
|
|
- name: End to End Tests
|
|
run: |
|
|
npm ci
|
|
npm start &
|
|
cd cypress
|
|
npm ci
|
|
node cleanup.js
|
|
npm run wait-for-server
|
|
npx cypress run --browser chrome --headless --spec "./integration/dataexplorer/MONGO/*"
|
|
shell: bash
|
|
env:
|
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
|
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
|
|
CYPRESS_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_MONGO }}
|
|
- uses: actions/upload-artifact@v2
|
|
if: ${{ failure() }}
|
|
name: videos
|
|
with:
|
|
path: "**/*.mp4"
|
|
accessibility:
|
|
name: "Accessibility | Hosted"
|
|
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
|
|
- 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 &
|
|
npx wait-on -i 5000 https-get://0.0.0.0:1234/
|
|
node utils/accesibilityCheck.js
|
|
shell: bash
|
|
env:
|
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
|
endtoendpuppeteer:
|
|
name: "End to end puppeteer tests"
|
|
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
|
|
- name: End to End Puppeteer Tests
|
|
run: |
|
|
npm ci
|
|
npm start &
|
|
npm run wait-for-server
|
|
npm run test:e2e
|
|
shell: bash
|
|
env:
|
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
|
PORTAL_RUNNER_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_SQL }}
|
|
nuget:
|
|
name: Publish Nuget
|
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
|
needs: [lint, format, compile, build, unittest, endtoendemulator, endtoendsql, endtoendmongo]
|
|
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
|
|
- run: cp ./configs/prod.json config.json
|
|
- 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
|
|
name: packages
|
|
with:
|
|
path: "*.nupkg"
|
|
nugetmpac:
|
|
name: Publish Nuget MPAC
|
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
|
needs: [lint, format, compile, build, unittest, endtoendemulator, endtoendsql, endtoendmongo]
|
|
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
|
|
- run: cp ./configs/mpac.json config.json
|
|
- 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
|
|
name: packages
|
|
with:
|
|
path: "*.nupkg"
|