Test workflow file if it checks out another repo to test this repo #30
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: CI for new Tutors | |
on: | |
push: | |
branches: ["development", "main"] | |
pull_request: | |
types: [opened, synchronize] | |
branches: | |
- development | |
- main | |
jobs: | |
app: | |
name: Build & Test App | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
- name: Install dependencies | |
run: npm install | |
working-directory: ./ | |
- name: Create app env | |
run: cp .env.example .env | |
working-directory: ./ | |
- name: Build app | |
run: npm run build | |
working-directory: ./ | |
cypress-tests: | |
name: Run Cypress Tests | |
runs-on: ubuntu-latest | |
needs: app # Ensure the 'app' job has completed before running Cypress tests | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
- name: Install Cypress | |
run: npm install -g cypress | |
- name: Check out Cypress tests | |
uses: actions/checkout@v3 | |
with: | |
repository: tutors-sdk/tutors-apps | |
path: ./dynamic-app-tests | |
ref: test/add-cypress-tests | |
- name: Run Cypress tests | |
run: npx cypress run --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --config-file ./dynamic-app-tests/cypress/cypress.config.ts | |
working-directory: ./ |