Skip to content

Commit

Permalink
Analyse greenFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoub77200 committed Nov 12, 2024
1 parent 901ee09 commit e617e4a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test
on:
push:
jobs:
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: Measure carbon footprint
uses: marmelab/[email protected]
env:
GREENFRAME_SECRET_TOKEN: ${{secrets.GREENFRAME_SECRET_TOKEN}}
5 changes: 5 additions & 0 deletions .greenframe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
baseURL: http://localhost
projectName: TIMY
scenarios:
- path: ./benchmark/scenario1.js
name: Consulter l'agenda
10 changes: 10 additions & 0 deletions benchmark/scenario1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const visit = async (page) => {
await page.goto('', {
waitUntil: 'networkidle',
});
await page.waitForTimeout(10000);
await page.scrollToEnd();
await page.waitForNetworkIdle();
await page.waitForTimeout(7000);
};
module.exports = visit;

0 comments on commit e617e4a

Please sign in to comment.