Skip to content

Commit

Permalink
Build UI static files + check generation with GHAction
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Jul 6, 2023
1 parent 8f959a0 commit fad348f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/check-generated-files.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: check-generated-files
on:
pull_request:
branches:
- main

jobs:
check-ui-static-files:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Generate static files for UI
run: make ui-static

- name: Verify Changed files
uses: tj-actions/verify-changed-files@v16
id: verify-changed-files

- name: Some files have changed
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
echo "::error Changed files: ${{ steps.verify-changed-files.outputs.changed_files }} -- Please regenerate with make ui-static"
exit 1
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ default: bin
help: ## Show this help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

.PHONY: ui-static
ui-static: ## build static files for UI to be served by embedded API server
(cd ui && npm install && npm run build) && rm -rf pkg/apiserver-impl/ui/* && mv ui/dist/devfile-builder/* pkg/apiserver-impl/ui/

.PHONY: bin
bin: ## build the odo binary
go build ${BUILD_FLAGS} cmd/odo/odo.go
Expand Down

0 comments on commit fad348f

Please sign in to comment.