-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added greenframe scenarios for prototype 1.
- Loading branch information
1 parent
cf12648
commit 5a853af
Showing
4 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,46 @@ | ||
name: Test | ||
name: Footprint | ||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
evaluate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download sources | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Greenframe needs the whole history | ||
|
||
- name: Set up NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
cache-dependency-path: frontend/package-lock.json | ||
|
||
- name: Install frontend dependencies | ||
run: | | ||
cd frontend | ||
npm install | ||
- name: Build frontend | ||
run: | | ||
cd frontend | ||
npm run build | ||
- name: Start frontend | ||
run: | | ||
docker compose up --detach | ||
- name: Wait for frontend | ||
uses: docker://benel/wait-for-response:1 | ||
with: | ||
args: http://localhost/ 200 30000 500 | ||
|
||
- name: Watch frontend initial payload | ||
run: curl --silent localhost | ||
run: curl --silent localhost | ||
|
||
- name: Measure carbon footprint | ||
uses: marmelab/[email protected] | ||
env: | ||
GREENFRAME_SECRET_TOKEN: ${{secrets.GREENFRAME_SECRET_TOKEN}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
baseURL: http://localhost | ||
projectName: Blutt | ||
scenarios: | ||
- path: ./benchmark/scenario1.js | ||
name: Rechercher un covoiturage | ||
- path: ./benchmark/scenario2.js | ||
name: Créer un covoiturage |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const visit = async (page) => { | ||
await page.goto('carpool-search', { | ||
waitUntil: 'networkidle', | ||
}); | ||
await page.waitForTimeout(10000); | ||
await page.scrollToEnd(); | ||
await page.waitForNetworkIdle(); | ||
await page.waitForTimeout(7000); | ||
}; | ||
module.exports = visit; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const visit = async (page) => { | ||
await page.goto('carpooler-home', { | ||
waitUntil: 'networkidle', | ||
}); | ||
await page.waitForTimeout(10000); | ||
await page.waitForNetworkIdle(); | ||
await page.waitForTimeout(7000); | ||
}; | ||
module.exports = visit; |