name: Build on: [push, pull_request] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [10.x, 12.x] browser: [chrome] steps: - uses: actions/checkout@v1 - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - name: Install Yarn run: npm i yarn --global - name: Cache Node Modules uses: actions/cache@v1 with: path: ~/.cache/yarn key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }} - name: Install Packages run: | yarn config set cache-folder ~/.cache/yarn yarn install --frozen-lockfile - name: Install Cypress uses: cypress-io/github-action@v1 with: runTests: false - name: Run Build run: yarn build - name: Upload Build as Artifact uses: actions/upload-artifact@v1 with: name: dist path: dist - name: Run Unit Tests run: | yarn test --coverage - name: Upload Test Results uses: coverallsapp/github-action@v1.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} parallel: true - 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: Upload cypress screenshots uses: actions/upload-artifact@master with: name: cypress-screenshots path: cypress/screenshots if: failure() - name: Upload cypress videos uses: actions/upload-artifact@master if: always() with: 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