From 275c2e16da36f32dd206dbb4d067ac951eb956b7 Mon Sep 17 00:00:00 2001 From: DanielHabenicht Date: Sat, 31 Oct 2020 12:26:57 +0100 Subject: [PATCH 1/3] chore: add nightly test on more devices --- .github/workflows/nightly-test.yaml | 115 ++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/nightly-test.yaml diff --git a/.github/workflows/nightly-test.yaml b/.github/workflows/nightly-test.yaml new file mode 100644 index 00000000..634b6da5 --- /dev/null +++ b/.github/workflows/nightly-test.yaml @@ -0,0 +1,115 @@ +name: PR-Checks + +on: + schedule: + - cron: '0 3 * * *' + +jobs: + build-head: + name: "Build head" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: "master" + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - uses: actions/cache@v2 + id: yarn-cache + with: + path: "**/node_modules" + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - name: Install dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install + - name: Build + run: yarn build + - name: Upload dist + uses: actions/upload-artifact@v1 + with: + name: dist + path: ./dist + + e2e-test: + name: "E2E Tests" + runs-on: ubuntu-latest + needs: [build-head] + steps: + - uses: actions/checkout@v2 + with: + ref: "${{github.event.pull_request.head.ref}}" + repository: "${{github.event.pull_request.head.repo.full_name}}" + - uses: actions/cache@v2 + id: yarn-cache + with: + path: '**/node_modules' + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - name: Install dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install + - name: Download base artifact + uses: actions/download-artifact@v1 + with: + name: dist + - name: test + run: yarn run testcafe chrome:headless testcafe/*.spec.ts --app "cd ./dist && http-server -p 8080" + + e2e-test-browserstack: + name: "E2E Tests BrowserStack" + runs-on: ubuntu-latest + needs: [build-head] + steps: + - uses: actions/checkout@v2 + with: + ref: "${{github.event.pull_request.head.ref}}" + repository: "${{github.event.pull_request.head.repo.full_name}}" + - uses: actions/cache@v2 + id: yarn-cache + with: + path: '**/node_modules' + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - name: Install dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install + - name: Download base artifact + uses: actions/download-artifact@v1 + with: + name: dist + - name: 'BrowserStack Env Setup' + uses: 'browserstack/github-actions/setup-env@master' + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + build-name: 'covmapperpr${{ github.event.pull_request.number }}' + project-name: 'CovMap' + - name: 'BrowserStackLocal Setup' + uses: 'browserstack/github-actions/setup-local@master' + with: + local-testing: start + local-identifier: random + # https://markus.oberlehner.net/blog/dealing-with-the-browserstack-parallel-test-limit-when-using-testcafe/ http-server + # https://github.com/DevExpress/testcafe/issues/1330 Browser List + # https://www.npmjs.com/package/testcafe-browser-provider-browserstack testcafe doc + - name: test chrome + run: | + export BROWSERSTACK_USE_AUTOMATE="1" + export BROWSERSTACK_DISPLAY_RESOLUTION="1024x768" + yarn run http-server dist/ -p 8080 -s & + sleep 5 + curl http://localhost:8080 + yarn run testcafe -c 1 "browserstack:Samsung Galaxy S8" testcafe/*.spec.ts + yarn run testcafe -c 1 "browserstack:chrome:Windows 10" testcafe/*.spec.ts + yarn run testcafe -c 1 "browserstack:firefox:Windows 10" testcafe/*.spec.ts + yarn run testcafe -c 1 "browserstack:edge:Windows 10" testcafe/*.spec.ts + yarn run testcafe -c 1 "browserstack:opera:Windows 10" testcafe/*.spec.ts + yarn run testcafe -c 1 "browserstack:IE:Windows 10" testcafe/*.spec.ts + yarn run testcafe -c 1 "browserstack:safari:OS X Catalina" testcafe/*.spec.ts --skip-js-errors + yarn run testcafe -c 1 "browserstack:Pixel 4" testcafe/*.spec.ts + yarn run testcafe -c 1 "browserstack:Redmi Note 8" testcafe/*.spec.ts + yarn run testcafe -c 1 "browserstack:Moto G7 Play" testcafe/*.spec.ts + - name: 'BrowserStackLocal Stop' + uses: 'browserstack/github-actions/setup-local@master' + with: + local-testing: stop From ba226df3b516abe1de96e8e6a654a669a712ff8f Mon Sep 17 00:00:00 2001 From: DanielHabenicht Date: Sat, 31 Oct 2020 12:27:31 +0100 Subject: [PATCH 2/3] Update .github/workflows/nightly-test.yaml --- .github/workflows/nightly-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-test.yaml b/.github/workflows/nightly-test.yaml index 634b6da5..260a4445 100644 --- a/.github/workflows/nightly-test.yaml +++ b/.github/workflows/nightly-test.yaml @@ -1,4 +1,4 @@ -name: PR-Checks +name: Nightly-Test on: schedule: From bf3bad2734d013ad031e2a13dfc9a9485ea2d23a Mon Sep 17 00:00:00 2001 From: DanielHabenicht Date: Sat, 31 Oct 2020 13:04:09 +0100 Subject: [PATCH 3/3] Apply suggestions from code review --- .github/workflows/nightly-test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly-test.yaml b/.github/workflows/nightly-test.yaml index 260a4445..447f40a5 100644 --- a/.github/workflows/nightly-test.yaml +++ b/.github/workflows/nightly-test.yaml @@ -98,7 +98,6 @@ jobs: export BROWSERSTACK_DISPLAY_RESOLUTION="1024x768" yarn run http-server dist/ -p 8080 -s & sleep 5 - curl http://localhost:8080 yarn run testcafe -c 1 "browserstack:Samsung Galaxy S8" testcafe/*.spec.ts yarn run testcafe -c 1 "browserstack:chrome:Windows 10" testcafe/*.spec.ts yarn run testcafe -c 1 "browserstack:firefox:Windows 10" testcafe/*.spec.ts @@ -109,6 +108,8 @@ jobs: yarn run testcafe -c 1 "browserstack:Pixel 4" testcafe/*.spec.ts yarn run testcafe -c 1 "browserstack:Redmi Note 8" testcafe/*.spec.ts yarn run testcafe -c 1 "browserstack:Moto G7 Play" testcafe/*.spec.ts + yarn run testcafe -c 1 "browserstack:iPhone XS" testcafe/*.spec.ts + yarn run testcafe -c 1 "browserstack:iPad Pro 12.9 2020" testcafe/*.spec.ts - name: 'BrowserStackLocal Stop' uses: 'browserstack/github-actions/setup-local@master' with: