Skip to content

Commit

Permalink
ci: simplify env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
ochafik committed Dec 22, 2024
1 parent beb4be7 commit 435aa6c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
name: dist-node-${{ matrix.node.name }}
path: dist
retention-days: 30
- run: START_MODE=dev npm run test:e2e
- run: START_MODE=prod npm run test:e2e
- run: NODE_ENV=development npm run test:e2e
- run: NODE_ENV=production npm run test:e2e
6 changes: 2 additions & 4 deletions jest-puppeteer.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
const isProd = process.env.START_MODE === 'prod';

module.exports = {
launch: {
headless: process.env.CI === "true",
},
server: {
command: `npm run start:${isProd ? 'prod' : 'dev'}`,
port: isProd ? 3000 : 4000,
command: `npm run start:${process.env.NODE_ENV}`,
port: process.env.NODE_ENV === 'production' ? 3000 : 4000,
launchTimeout: 180000,
},
};
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
},
"scripts": {
"test:e2e": "jest",
"start:dev": "concurrently 'npx webpack serve --mode=development' 'NODE_ENV=development npx rollup --config openscad-worker.rollup.config.js --watch'",
"start:prod": "PUBLIC_URL=http://localhost:3000/dist/ npm run build && npx serve",
"start": "npm run start:dev",
"start:development": "concurrently 'npx webpack serve --mode=development' 'NODE_ENV=development npx rollup --config openscad-worker.rollup.config.js --watch'",
"start:production": "NODE_ENV=production PUBLIC_URL=http://localhost:3000/dist/ npm run build && npx serve",
"start": "npm run start:development",
"build": "NODE_ENV=production npx rollup --config openscad-worker.rollup.config.js && webpack --mode=production"
},
"eslintConfig": {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const longTimeout = 60000;

const isProd = process.env.START_MODE === 'prod';
const isProd = process.env.NODE_ENV === 'production';
const url = isProd ? 'http://localhost:3000/dist/' : 'http://localhost:4000';

describe('e2e', () => {
Expand Down

0 comments on commit 435aa6c

Please sign in to comment.