diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 07d335ce..119eefcb 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -38,11 +38,6 @@ jobs: with: node: ${{ env.NODE_VERSION }} - - name: Setup common dependencies - run: | - npm ci --prefix=examples/users-api - mv examples/users-api/.env.sample examples/users-api/.env - - name: Save build artifacts uses: actions/cache/save@v3 with: @@ -65,34 +60,15 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'npm' - - - name: Update /etc/hosts - run: | - sudo echo "127.0.0.1 localhost" | sudo tee -a /etc/hosts - - - name: Restore build artifacts - uses: actions/cache/restore@v3 + - name: Prepare integration test + uses: ./.github/actions/integration with: - path: . + integration: 'cra-react-router' + node: ${{ env.NODE_VERSION }} key: ${{ env.CACHE_KEY }} - - name: Restore Cypress - uses: actions/cache/restore@v3 - with: - path: /home/runner/.cache/Cypress - key: ${{ env.CACHE_KEY }}-cypress - - name: Run integration tests run: | - npm ci - npm ci --prefix=examples/users-api - npm i --prefix=examples/cra-react-router --no-package-lock --legacy-peer-deps - mv examples/cra-react-router/.env.sample examples/cra-react-router/.env npm run test:cra env: SKIP_PREFLIGHT_CHECK: true @@ -111,34 +87,15 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'npm' - - - name: Update /etc/hosts - run: | - sudo echo "127.0.0.1 localhost" | sudo tee -a /etc/hosts - - - name: Restore build artifacts - uses: actions/cache/restore@v3 + - name: Prepare integration test + uses: ./.github/actions/integration with: - path: . + integration: 'gatsby-app' + node: ${{ env.NODE_VERSION }} key: ${{ env.CACHE_KEY }} - - name: Restore Cypress - uses: actions/cache/restore@v3 - with: - path: /home/runner/.cache/Cypress - key: ${{ env.CACHE_KEY }}-cypress - - name: Run integration tests run: | - npm ci - npm ci --prefix=examples/users-api - npm i --prefix=examples/gatsby-app --no-package-lock --legacy-peer-deps - mv examples/gatsby-app/.env.development.sample examples/gatsby-app/.env npm run test:gatsby env: GATSBY_DOMAIN: your-tenant.auth0.com @@ -156,34 +113,15 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'npm' - - - name: Update /etc/hosts - run: | - sudo echo "127.0.0.1 localhost" | sudo tee -a /etc/hosts - - - name: Restore build artifacts - uses: actions/cache/restore@v3 + - name: Prepare integration test + uses: ./.github/actions/integration with: - path: . + integration: 'nextjs-app' + node: ${{ env.NODE_VERSION }} key: ${{ env.CACHE_KEY }} - - name: Restore Cypress - uses: actions/cache/restore@v3 - with: - path: /home/runner/.cache/Cypress - key: ${{ env.CACHE_KEY }}-cypress - - name: Run integration tests run: | - npm ci - npm ci --prefix=examples/users-api - npm i --prefix=examples/nextjs-app --no-package-lock --legacy-peer-deps - mv examples/nextjs-app/.env.sample examples/nextjs-app/.env npm run test:nextjs env: NEXT_PUBLIC_DOMAIN: your-tenant.auth0.com