name: Cypress tests - PR on: push: branches: - develop - main pull_request: types: - opened - reopened - synchronize - ready_for_review jobs: pr: runs-on: ubuntu-latest steps: # Checkout front ends - name: Checkout frontend mono repo uses: actions/checkout@v2 with: fetch-depth: 0 path: './frontend-monorepo' # Restore node_modules from cache if possible - name: Restore node_modules from cache uses: actions/cache@v3 with: path: | frontend-monorepo/node_modules /home/runner/.cache/Cypress key: node_modules_cypress-${{ hashFiles('frontend-monorepo/yarn.lock', 'frontend-monorepo/package.json') }} # Install frontend dependencies - name: Install root dependencies run: yarn install --frozen-lockfile working-directory: frontend-monorepo # Check SHAs - name: Derive appropriate SHAs for base and head for `nx affected` commands uses: nrwl/nx-set-shas@v2 with: working-directory: frontend-monorepo main-branch-name: ${{ github.base_ref || github.ref_name }} set-environment-variables-for-job: true # See affected projects - name: See affected apps run: echo AFFECTED=$(yarn nx print-affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects) >> $GITHUB_ENV working-directory: frontend-monorepo outputs: projects: ${{ env.AFFECTED }} dispatch: needs: pr uses: ./.github/workflows/tests-dispatcher.yml secrets: inherit with: project: ${{ needs.pr.outputs.projects }} tags: "--env.grepTags='[ @smoke, @regression ]'"