name: pr on: pull_request jobs: changed-files: runs-on: ubuntu-22.04 steps: - name: Checkout 🛎 # https://github.com/actions/checkout uses: actions/checkout@v4 with: fetch-depth: 20 - name: Install dependencies 📦 # https://github.com/cypress-io/github-action uses: cypress-io/github-action@v6 with: runTests: false - name: Print dependencies between tests and utils 💻 run: npm run deps - name: Print files changed against the parent of this branch 🌳 run: | git --version git status git fetch git log --pretty=format:"%h %s" --graph --since=1.month git merge-base origin/main HEAD git diff --name-only --diff-filter=AMR $(git merge-base origin/main HEAD).. - name: Print specs changed against the parent of this branch 🌳 # and set GitHub Actions output id: step1 run: node ./bin/find --branch main --parent --set-gha-outputs --gha-summary --specs-per-machine 4 --max-machines 2 - name: Print set outputs run: echo ${{ steps.step1.outputs.changedSpecsN }} specs ${{ steps.step1.outputs.changedSpecs }} machines ${{ steps.step1.outputs.machinesNeeded }} - name: Print changed specs if you trace imports and requires 🔭 # in the folder "cypress" id: step2 run: node ./bin/find --branch main --parent --trace-imports cypress --set-gha-outputs - name: Print set outputs run: echo ${{ steps.step2.outputs.changedSpecsN }} ${{ steps.step2.outputs.changedSpecs }} - name: Saving traced dependencies run: node ./bin/find --branch main --parent --trace-imports cypress --cache-trace --time-trace - name: Loading cached traced dependencies run: node ./bin/find --branch main --parent --trace-imports cypress --cache-trace - name: Print specs sorted by last modified date run: node ./bin/find --branch main --parent --sort-by-modified --set-gha-outputs # module and import support - name: Test module support run: npm run demo-tests working-directory: test-modules - name: Trace TS path aliases demo run: npm run deps working-directory: test-ts-aliases - name: Test cypress.json project (Cypress v9) run: npm run demo-tests --prefix test-json - name: Find tests in subfolder run: npm run demo-subfolder - name: Demo test names in Markdown format and put into job summary 💻 run: npm run demo-names-markdown >> "$GITHUB_STEP_SUMMARY" - name: Show specs with tags id: find-tagged run: node ./bin/find --tagged @user --set-gha-outputs - name: Print the found specs with tags run: | echo '${{ steps.find-tagged.outputs.taggedSpecsN }} Specs with tests tagged user' >> "$GITHUB_STEP_SUMMARY" echo '${{ steps.find-tagged.outputs.taggedSpecs }}' >> "$GITHUB_STEP_SUMMARY" - name: Confirm we can run specs in subfolder uses: cypress-io/github-action@v6 with: # we have already installed all dependencies above install: false config-file: mocks/my-app/e2e/cypress.config.js - name: Produce HTML report run: node ./bin/find --names --write-html-filename report/index.html - name: Save HTML report uses: actions/upload-artifact@v4 with: name: report path: report/index.html - name: Test HTML output uses: cypress-io/github-action@v6 with: install: false config: specPattern=cypress/html-e2e/**/*.cy.js