Skip to content

Commit

Permalink
CI: Update build actions (#2697)
Browse files Browse the repository at this point in the history
* ui coverage
* name artifacts
* Update release.yml
  • Loading branch information
da-Kai authored Jul 3, 2024
1 parent 051489e commit 7b6e982
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ jobs:

- uses: kiancross/checkstyle-annotations-action@v1

- name: Checkstyle
run: ./gradlew checkstyleAll --console=plain --warn

- name: Build all Java packages
run: ./gradlew build
run: ./gradlew build --console=plain --warn

- name: Resolve OpenEMS bundles
run: ./gradlew resolve
run: ./gradlew resolve --console=plain --warn

- name: Validate BackendApp.bndrun
run: git diff --exit-code io.openems.backend.application/BackendApp.bndrun
Expand Down Expand Up @@ -64,13 +67,12 @@ jobs:
- name: Build OpenEMS UI
run: |
cd ui
npm install
npm ci --prefer-offline --cache ~/.npm
node_modules/.bin/ng config cli.cache.path "~/.ng"
node_modules/.bin/ng build -c "openems,openems-edge-prod,prod"
node_modules/.bin/ng lint
export CHROME_BIN=/usr/bin/google-chrome-stable
npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
npm run test -- --code-coverage --no-watch --no-progress --browsers=ChromeHeadlessCI
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
Expand Down
32 changes: 19 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ jobs:

- uses: kiancross/checkstyle-annotations-action@v1

- name: Checkstyle
run: ./gradlew checkstyleAll --console=plain --warn

- name: Build all Java packages
run: ./gradlew build
run: ./gradlew build --console=plain --warn

- name: Resolve OpenEMS bundles
run: ./gradlew resolve
run: ./gradlew resolve --console=plain --warn

- name: Validate BackendApp.bndrun
run: git diff --exit-code io.openems.backend.application/BackendApp.bndrun
Expand All @@ -33,12 +36,12 @@ jobs:
run: git diff --exit-code io.openems.edge.application/EdgeApp.bndrun

- name: Prepare Edge+Backend assets
run: ./gradlew buildEdge buildBackend
run: ./gradlew buildEdge buildBackend --console=plain --warn

- name: Save build-artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
name: java-build-artifacts
path: |
build/openems-edge.jar
build/openems-backend.jar
Expand All @@ -65,7 +68,6 @@ jobs:
- name: Build OpenEMS UI
run: |
cd ui
npm install
npm ci --prefer-offline --cache ~/.npm
node_modules/.bin/ng config cli.cache.path "~/.ng"
node_modules/.bin/ng build -c "openems,openems-edge-prod,prod"
Expand All @@ -75,24 +77,28 @@ jobs:
- name: Prepare UI asset
run: |
mkdir build
cd ui/target
zip -r ../../build/openems-ui.zip ./*
tar --xz --transform 's|^ui/target|openems-ui|' -cvf openems-ui.tar.xz ui/target/
- name: Save build-artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: build/openems-ui.zip
name: ui-build-artifacts
path: openems-ui.tar.xz

release:
runs-on: ubuntu-latest
needs: [build-java, build-ui]
steps:
- name: Load build-artifacts
- name: Load Java build-artifacts
uses: actions/download-artifact@v4
with:
name: java-build-artifacts
path: build

- name: Load UI build-artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
name: ui-build-artifacts
path: build

- name: Create draft Release
Expand All @@ -102,4 +108,4 @@ jobs:
files: |
build/openems-edge.jar
build/openems-backend.jar
build/openems-ui.zip
build/openems-ui.tar.xz

0 comments on commit 7b6e982

Please sign in to comment.