Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wip): ci #471

Merged
merged 34 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 39 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
- main

jobs:
build:
name: Build
app:
name: Build & Test App
timeout-minutes: 15
runs-on: ubuntu-latest

Expand All @@ -29,58 +29,59 @@ jobs:

- name: Install dependencies
run: npm install
working-directory: ./app

- name: Create app env
run: cp .env.example .env
working-directory: ./app

- name: Build
- name: Build app
run: npm run build
working-directory: ./app

- name: Run preview & cypress tests
run: npm run preview & npx cypress run --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome
working-directory: ./app

testApp:
name: Test App
publish-html:
name: Build & test tutors-publish-html
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
- name: Install Dependencies
run: npm install
working-directory: ./app

- name: Create env
run: cp .env.example .env
working-directory: ./app

- name: Start SvelteKit Server
run: npm run dev &
working-directory: ./app

- name: Build tutors-publish-html
run: npm run build
working-directory: ./cli/tutors-publish-html
- name: Run tutors-publish-html on example course
run: node ../../cli/tutors-publish-html/src/tutors-publish-html.js
working-directory: ./doc/reference-course
- name: Run cypress tests
uses: cypress-io/github-action@v5
with:
browser: chrome
record: true
project: ./app
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
run: npx cypress run --record --key ${{ secrets.HTML_CYPRESS_RECORD_KEY }} --browser chrome
working-directory: ./doc/reference-course

- name: Stop SvelteKit Server
run: pkill -f "sirv" || true

testHTMLGenerator:
name: Test HTML Generator
publish:
name: Build tutors-publish
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
- name: Install Dependencies
run: npm install
- name: publish-html
run: cd doc/reference-course; npm i -g tutors-gen-lib; npx -y ts-node ../../cli/tutors-publish-html/src/tutors-publish-html.ts
- name: Run cypress tests
uses: cypress-io/github-action@v5
with:
browser: chrome
record: true
project: ./doc/reference-course
env:
CYPRESS_RECORD_KEY: ${{ secrets.HTML_CYPRESS_RECORD_KEY }}
working-directory: ./cli/tutors-publish
- name: Build tutors-publish
run: npm run build
working-directory: ./cli/tutors-publish
12 changes: 10 additions & 2 deletions app/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@ export default defineConfig({
return config;
},
trashAssetsBeforeRuns: true,
baseUrl: process.env.DEPLOY_URL || "http://localhost:3000",
baseUrl: "http://localhost:3000",
// baseUrl:"https://tutors.dev/course/tutors-cypress-testing",
specPattern: "cypress/e2e/**/**.cy.ts"
}
},
component: {
devServer: {
framework: "svelte",
bundler: "vite"
}
},
viewportHeight: 1080,
viewportWidth: 1920
});
3 changes: 0 additions & 3 deletions app/cypress/e2e/tutorsReader.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ describe("Tutors Reader: Loading the JSON fixture", function () {
});

beforeEach("Check: Define the dimensions of the screen being used", function () {
//This defines the dimensions of the screen
cy.viewport(1440, 1440);
cy.visit(`${Cypress.config().baseUrl}/course/tutors-cypress-testing`);
});

Expand All @@ -21,7 +19,6 @@ describe("Tutors Reader: Loading the JSON fixture", function () {
* cards. You would expect all to match as it is coming from the JSON fixture
*/
it("Course Reference page", function () {
cy.wait(30000);
cy.get(".app-bar", { timeout: 30000 }).contains(course.title.trim());
cy.get(".z-10").contains(course.title.trim());
course.los.forEach((topic: any) => {
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dev": "vite dev --port 3000 --open",
"build": "vite build",
"package": "vite package",
"preview": "vite preview",
"preview": "vite preview --port 3000 --open",
"prepare": "svelte-kit sync",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
Expand Down
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"dev": {
"cache": false
},
"preview": {
"dependsOn": ["^build"]
}
}
}
Loading