mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
chore: avoid building frontend when possible (#3278)
## About the changes This is based on @nunogois suggestion to split the build in two, so we don't build the frontend every time we run `yarn` e2e frontend tests were forced to run by modifying frontend/README.md ### Important files Some github actions had to be updated to also build the frontend. The Dockerfile building our docker image was also looked into but it should work as is ## Discussion points This is a potentially risky operation as we might overlook something that requires building the frontend which might lead to invalid builds. We need to make sure when we do this we don't have any release planned.
This commit is contained in:
parent
c2d51e4549
commit
8cdd68914e
1
.github/workflows/build.yaml
vendored
1
.github/workflows/build.yaml
vendored
@ -38,6 +38,7 @@ jobs:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'yarn'
|
||||
- run: yarn
|
||||
# - run: yarn build:frontend # not needed
|
||||
- run: yarn lint
|
||||
- run: yarn run test
|
||||
env:
|
||||
|
1
.github/workflows/build_coverage.yaml
vendored
1
.github/workflows/build_coverage.yaml
vendored
@ -39,6 +39,7 @@ jobs:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'yarn'
|
||||
- run: yarn
|
||||
- run: yarn build:frontend
|
||||
- run: yarn run test:coverage
|
||||
env:
|
||||
CI: true
|
||||
|
1
.github/workflows/build_prs.yaml
vendored
1
.github/workflows/build_prs.yaml
vendored
@ -20,3 +20,4 @@ jobs:
|
||||
- run: yarn install --frozen-lockfile --ignore-scripts
|
||||
- run: yarn lint
|
||||
- run: yarn build
|
||||
#- run: yarn build:frontend # not needed
|
||||
|
1
.github/workflows/release.yaml
vendored
1
.github/workflows/release.yaml
vendored
@ -22,6 +22,7 @@ jobs:
|
||||
cache: 'yarn'
|
||||
- run: |
|
||||
yarn install --frozen-lockfile
|
||||
yarn --cwd ./frontend install --frozen-lockfile
|
||||
- run: |
|
||||
LATEST=$(npm show unleash-server version)
|
||||
TAG=$(node scripts/npm-tag.js $LATEST)
|
||||
|
@ -8,7 +8,7 @@ First, start the unleash-api backend on port 4242.
|
||||
Then, start the frontend dev server:
|
||||
|
||||
```
|
||||
cd ~/frontend
|
||||
cd ./frontend
|
||||
yarn install
|
||||
yarn run start
|
||||
```
|
||||
@ -18,7 +18,7 @@ yarn run start
|
||||
Alternatively, instead of running unleash-api on localhost, you can use a remote instance:
|
||||
|
||||
```
|
||||
cd ~/frontend
|
||||
cd ./frontend
|
||||
yarn install
|
||||
yarn run start:sandbox
|
||||
```
|
||||
|
@ -38,13 +38,15 @@
|
||||
"build:watch": "tsc -w --strictNullChecks false",
|
||||
"prebuild": "yarn run clean",
|
||||
"build": "yarn run copy-templates && tsc --pretty --strictNullChecks false",
|
||||
"prepare": "node scripts/husky-install && cd frontend && yarn && cd .. && yarn run build",
|
||||
"build:frontend": "yarn --cwd ./frontend",
|
||||
"prepare": "node scripts/husky-install && yarn run build",
|
||||
"test": "NODE_ENV=test PORT=4243 jest",
|
||||
"test:unit": "NODE_ENV=test PORT=4243 jest --testPathIgnorePatterns=src/test/e2e --testPathIgnorePatterns=dist",
|
||||
"test:docker": "./scripts/docker-postgres.sh",
|
||||
"test:docker:cleanup": "docker rm -f unleash-postgres",
|
||||
"test:watch": "yarn test --watch",
|
||||
"test:coverage": "NODE_ENV=test PORT=4243 jest --coverage --testLocationInResults --outputFile=\"coverage/report.json\" --forceExit --testTimeout=10000",
|
||||
"pretest:coverage:jest": "yarn build:frontend",
|
||||
"test:coverage:jest": "NODE_ENV=test PORT=4243 jest --silent --ci --json --coverage --testLocationInResults --outputFile=\"report.json\" --forceExit --testTimeout=10000",
|
||||
"seed:setup": "ts-node src/test/e2e/seed/segment.seed.ts",
|
||||
"seed:serve": "UNLEASH_DATABASE_NAME=unleash_test UNLEASH_DATABASE_SCHEMA=seed yarn run start:dev",
|
||||
|
Loading…
Reference in New Issue
Block a user