Merge pull request #38 from webstack-builders/dependabot/npm_and_yarn… #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cypress E2E tests | |
on: [push, pull_request] | |
jobs: | |
cypress-run: | |
strategy: | |
matrix: | |
os: ['macos-latest'] | |
node-version: ['14'] | |
fail-fast: true | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} | Node ${{ matrix.node-version }} latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache "node_modules" | |
uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: node_modules_${{ runner.os }}_${{ hashFiles('**/yarn.lock') }} | |
- name: Install framework modules | |
run: npm install | |
- name: Create a temporary directory | |
id: createpath | |
run: | | |
project_path=$(mktemp -d -t webstackbuilders.XXXXXX) | |
echo "::set-output name=project_path::$project_path" | |
- name: Create a RedwoodJS app | |
run: ./tasks/run-e2e ${{ steps.createpath.outputs.project_path }} --no-start | |
- name: Start server in background | |
run: yarn rw dev --no-generate --fwd="--open=false" & | |
working-directory: ${{ steps.createpath.outputs.project_path }} | |
- name: Cypress run | |
uses: cypress-io/github-action@v2 | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CYPRESS_RW_PATH: "${{ steps.createpath.outputs.project_path }}" | |
with: | |
browser: chrome | |
env: true | |
wait-on: 'http://localhost:8910' | |
record: false | |
working-directory: ./tasks/e2e |