diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac2a8b864..5c38b8e04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,7 @@ jobs: strategy: matrix: node-version: [10.x, 12.x] + browser: [chrome] steps: - uses: actions/checkout@v1 @@ -25,20 +26,15 @@ jobs: path: ~/.cache/yarn key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }} - - name: Cache Cypress - uses: actions/cache@v1 - with: - path: ~/.cache/Cypress - key: ${{ runner.os }}-cypress-${{ hashFiles('**/package.json') }} - - name: Install Packages run: | yarn config set cache-folder ~/.cache/yarn - export CYPRESS_CACHE_FOLDER=~/.cache/Cypress yarn install --frozen-lockfile - npx cypress cache path - npx cypress cache list - npx cypress verify + + - name: Install Cypress + uses: cypress-io/github-action@v1 + with: + runTests: false - name: Run Build run: yarn build @@ -59,31 +55,34 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} parallel: true - - name: Run E2E Tests - run: | - export CYPRESS_CACHE_FOLDER=~/.cache/Cypress - npx cypress cache path - npx cypress cache list - npx cypress install - yarn e2e + - uses: cypress-io/github-action@v1 + with: + browser: ${{ matrix.browser }} + headless: true + command-prefix: 'percy exec -- npx' + start: yarn dev + wait-on: 'http://localhost:9000' + install: false + working-directory: cypress env: PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} - - name: Post Upload Test Results - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel-finished: true - - name: Upload cypress screenshots uses: actions/upload-artifact@master with: - name: screenshots + name: cypress-screenshots path: cypress/screenshots if: failure() - name: Upload cypress videos uses: actions/upload-artifact@master + if: always() with: - name: videos + name: cypress-videos path: cypress/videos + + - name: Post Upload Test Results + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true