Skip to content

Commit

Permalink
chore: fix CI for vite
Browse files Browse the repository at this point in the history
  • Loading branch information
BatuhanW committed Sep 27, 2023
1 parent 6201bbb commit 5b2c92a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const buildRemote = async () => {
},
};

if (FRAMEWORK === "react") {
if (["react", "vite"].includes(FRAMEWORK)) {
body.answers["router-provider"] = "react-router-v6";
}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const buildTemplate = async () => {
},
};

if (FRAMEWORK === "react") {
if (["react", "vite"].includes(FRAMEWORK)) {
body.answers["router-provider"] = "react-router-v6";
}

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
cd ${{ steps.build_step.outputs.project_path }}
npm install
npm run build
npm run start
npm run preview -- --port 3000 &
- name: Run Cypress on local
uses: cypress-io/github-action@v4
with:
command: npx cypress run --record --group vite-${{ matrix.data_provider }}-${{ matrix.ui_framework }}-${{ steps.build_step.outputs.auth_provider }} --parallel --env=AUTH_PROVIDER=${{ steps.build_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=react,DATA_PROVIDER=${{ matrix.data_provider }}
command: npx cypress run --record --parallel --env=AUTH_PROVIDER=${{ steps.build_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=react,DATA_PROVIDER=${{ matrix.data_provider }}
install: false
start: "npm ls"
wait-on: "http://0.0.0.0:3000"
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Run Cypress on local
uses: cypress-io/github-action@v4
with:
command: npx cypress run --record --group react-${{ matrix.data_provider }}-${{ matrix.ui_framework }}-${{ steps.build_step.outputs.auth_provider }} --parallel --env=AUTH_PROVIDER=${{ steps.build_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=react,DATA_PROVIDER=${{ matrix.data_provider }}
command: npx cypress run --record --parallel --env=AUTH_PROVIDER=${{ steps.build_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=react,DATA_PROVIDER=${{ matrix.data_provider }}
install: false
start: "npm ls"
wait-on: "http://0.0.0.0:3000"
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
- name: Run Cypress on local
uses: cypress-io/github-action@v4
with:
command: npx cypress run --record --group nextjs-${{ matrix.data_provider }}-${{ matrix.ui_framework }}-${{ steps.build_step.outputs.auth_provider }} --parallel --env=AUTH_PROVIDER=${{ steps.build_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=nextjs,DATA_PROVIDER=${{ matrix.data_provider }}
command: npx cypress run --record --parallel --env=AUTH_PROVIDER=${{ steps.build_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=nextjs,DATA_PROVIDER=${{ matrix.data_provider }}
install: false
start: "npm ls"
wait-on: "http://0.0.0.0:3000"
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
- name: Run Cypress on local
uses: cypress-io/github-action@v4
with:
command: npx cypress run --record --group remix-${{ matrix.data_provider }}-${{ matrix.ui_framework }}-${{ steps.build_step.outputs.auth_provider }} --parallel --env=AUTH_PROVIDER=${{ steps.build_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=remix,DATA_PROVIDER=${{ matrix.data_provider }}
command: npx cypress run --record --parallel --env=AUTH_PROVIDER=${{ steps.build_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=remix,DATA_PROVIDER=${{ matrix.data_provider }}
install: false
start: "npm ls"
wait-on: "http://0.0.0.0:3000"
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/test-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
- workflow_dispatch

jobs:
refine-react:
refine-vite:
runs-on: ubuntu-latest
name: React
name: Vite
strategy:
fail-fast: false
matrix:
Expand All @@ -31,18 +31,17 @@ jobs:
run: npm install
- name: Download Example
id: download_step
run: FRAMEWORK=react CI_USER_AGENT=${{secrets.CI_USER_AGENT}} DATA_PROVIDER=${{matrix.data_provider}} UI_FRAMEWORK=${{matrix.ui_framework}} node ./.github/workflows/build-remote.js
run: FRAMEWORK=vite CI_USER_AGENT=${{secrets.CI_USER_AGENT}} DATA_PROVIDER=${{matrix.data_provider}} UI_FRAMEWORK=${{matrix.ui_framework}} node ./.github/workflows/build-remote.js
- name: Install & Build Deps
run: |
cd ${{ steps.download_step.outputs.project_path }}
npm install
npm run build
npm install -g serve
serve -s build &
npm run preview -- --port 3000 &
- name: Run Cypress on local
uses: cypress-io/github-action@v4
with:
command: npx cypress run --record --group react --parallel --env=AUTH_PROVIDER=${{ steps.download_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=react,DATA_PROVIDER=${{ matrix.data_provider }}
command: npx cypress run --record --parallel --env=AUTH_PROVIDER=${{ steps.download_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=react,DATA_PROVIDER=${{ matrix.data_provider }}
install: false
start: "npm ls"
wait-on: "http://0.0.0.0:3000"
Expand Down Expand Up @@ -88,7 +87,7 @@ jobs:
uses: cypress-io/github-action@v4
with:
install: false
command: npx cypress run --record --group nextjs --parallel --env=AUTH_PROVIDER=${{ steps.download_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=nextjs,DATA_PROVIDER=${{ matrix.data_provider }}
command: npx cypress run --record --parallel --env=AUTH_PROVIDER=${{ steps.download_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=nextjs,DATA_PROVIDER=${{ matrix.data_provider }}
start: "npm ls"
wait-on: "http://0.0.0.0:3000"
env:
Expand Down Expand Up @@ -132,7 +131,7 @@ jobs:
uses: cypress-io/github-action@v4
with:
install: false
command: npx cypress run --record --group remix --parallel --env=AUTH_PROVIDER=${{ steps.download_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=remix,DATA_PROVIDER=${{ matrix.data_provider }}
command: npx cypress run --record --parallel --env=AUTH_PROVIDER=${{ steps.download_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=remix,DATA_PROVIDER=${{ matrix.data_provider }}
start: "npm ls"
wait-on: "http://0.0.0.0:3000"
env:
Expand Down

0 comments on commit 5b2c92a

Please sign in to comment.