1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Cache make build-extensions (#1407)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-11-17 12:25:27 +02:00 committed by GitHub
parent 0ab0e56808
commit 5e5bac3264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 40 additions and 35852 deletions

View File

@ -36,11 +36,11 @@ jobs:
yarn yarn
path: $(YARN_CACHE_FOLDER) path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages displayName: Cache Yarn packages
- script: make install-deps - script: make node_modules
displayName: Install dependencies displayName: Install dependencies
- script: make build-npm - script: make build-npm
displayName: Generate npm package displayName: Generate npm package
- script: make build-extensions - script: make -j2 build-extensions
displayName: Build bundled extensions displayName: Build bundled extensions
- script: make integration-win - script: make integration-win
displayName: Run integration tests displayName: Run integration tests
@ -76,11 +76,11 @@ jobs:
yarn yarn
path: $(YARN_CACHE_FOLDER) path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages displayName: Cache Yarn packages
- script: make install-deps - script: make node_modules
displayName: Install dependencies displayName: Install dependencies
- script: make build-npm - script: make build-npm
displayName: Generate npm package displayName: Generate npm package
- script: make build-extensions - script: make -j2 build-extensions
displayName: Build bundled extensions displayName: Build bundled extensions
- script: make test - script: make test
displayName: Run tests displayName: Run tests
@ -122,13 +122,13 @@ jobs:
yarn yarn
path: $(YARN_CACHE_FOLDER) path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages displayName: Cache Yarn packages
- script: make install-deps - script: make node_modules
displayName: Install dependencies displayName: Install dependencies
- script: make lint - script: make lint
displayName: Lint displayName: Lint
- script: make build-npm - script: make build-npm
displayName: Generate npm package displayName: Generate npm package
- script: make build-extensions - script: make -j2 build-extensions
displayName: Build bundled extensions displayName: Build bundled extensions
- script: make test - script: make test
displayName: Run tests displayName: Run tests
@ -164,4 +164,4 @@ jobs:
displayName: Publish npm package displayName: Publish npm package
condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))" condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
env: env:
NPM_TOKEN: $(NPM_TOKEN) NPM_TOKEN: $(NPM_TOKEN)

View File

@ -1,4 +1,7 @@
EXTENSIONS_DIR = ./extensions EXTENSIONS_DIR = ./extensions
extensions = $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), ${dir})
extension_node_modules = $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), ${dir}/node_modules)
extension_dists = $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), ${dir}/dist)
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
DETECTED_OS := Windows DETECTED_OS := Windows
@ -6,29 +9,23 @@ else
DETECTED_OS := $(shell uname) DETECTED_OS := $(shell uname)
endif endif
.PHONY: init binaries/client:
init: install-deps download-bins compile-dev
echo "Init done"
.PHONY: download-bins
download-bins:
yarn download-bins yarn download-bins
.PHONY: install-deps node_modules:
install-deps:
yarn install --frozen-lockfile --verbose yarn install --frozen-lockfile --verbose
yarn check --verify-tree --integrity yarn check --verify-tree --integrity
static/build/LensDev.html:
yarn compile:renderer
.PHONY: compile-dev .PHONY: compile-dev
compile-dev: compile-dev:
yarn compile:main --cache yarn compile:main --cache
yarn compile:renderer --cache yarn compile:renderer --cache
.PHONY: dev .PHONY: dev
dev: dev: node_modules binaries/client build-extensions static/build/LensDev.html
ifeq ("$(wildcard static/build/main.js)","")
make init
endif
yarn dev yarn dev
.PHONY: lint .PHONY: lint
@ -36,7 +33,7 @@ lint:
yarn lint yarn lint
.PHONY: test .PHONY: test
test: download-bins test: binaries/client
yarn test yarn test
.PHONY: integration-linux .PHONY: integration-linux
@ -59,20 +56,25 @@ test-app:
yarn test yarn test
.PHONY: build .PHONY: build
build: install-deps download-bins build-extensions build: node_modules binaries/client build-extensions
ifeq "$(DETECTED_OS)" "Windows" ifeq "$(DETECTED_OS)" "Windows"
yarn dist:win yarn dist:win
else else
yarn dist yarn dist
endif endif
$(extension_node_modules):
cd $(@:/node_modules=) && npm install --no-audit --no-fund
$(extension_dists): src/extensions/npm/extensions/dist
cd $(@:/dist=) && npm run build
.PHONY: build-extensions .PHONY: build-extensions
build-extensions: build-extensions: $(extension_node_modules) $(extension_dists)
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), (cd $(dir) && npm install && npm run build || exit $?);)
.PHONY: test-extensions .PHONY: test-extensions
test-extensions: test-extensions: $(extension_node_modules)
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), (cd $(dir) && npm install --dev && npm run test || exit $?);) $(foreach dir, $(extensions), (cd $(dir) && npm run test || exit $?);)
.PHONY: copy-extension-themes .PHONY: copy-extension-themes
copy-extension-themes: copy-extension-themes:
@ -97,6 +99,16 @@ publish-npm: build-npm
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
cd src/extensions/npm/extensions && npm publish --access=public cd src/extensions/npm/extensions && npm publish --access=public
.PHONY: clean-extensions
clean-extensions:
ifeq "$(DETECTED_OS)" "Windows"
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), if exist $(dir)\dist del /s /q $(dir)\dist)
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), if exist $(dir)\node_modules del /s /q $(dir)\node_modules)
else
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), rm -rf $(dir)/dist)
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), rm -rf $(dir)/node_modules)
endif
.PHONY: clean-npm .PHONY: clean-npm
clean-npm: clean-npm:
ifeq "$(DETECTED_OS)" "Windows" ifeq "$(DETECTED_OS)" "Windows"
@ -110,13 +122,13 @@ else
endif endif
.PHONY: clean .PHONY: clean
clean: clean-npm clean: clean-npm clean-extensions
ifeq "$(DETECTED_OS)" "Windows" ifeq "$(DETECTED_OS)" "Windows"
if exist binaries\client del /s /q binaries\client\*.* if exist binaries\client del /s /q binaries\client
if exist dist del /s /q dist\*.* if exist dist del /s /q dist\*.*
if exist static\build del /s /q static\build\*.* if exist static\build del /s /q static\build\*.*
else else
rm -rf binaries/client/* rm -rf binaries/client
rm -rf dist/* rm -rf dist/*
rm -rf static/build/* rm -rf static/build/*
endif endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff