Skip to content

Commit b5262d9

Browse files
author
Jing T
authored
only produce artifact if Ci passes unit tests / auto-release when a tag is pushed. (#820)
* collapse test / build / releases workflow into one file to enforce dependencies properly * label as pre-release if tag ends with -nightly. used for creating daily builds.
1 parent 22a059d commit b5262d9

File tree

3 files changed

+92
-120
lines changed

3 files changed

+92
-120
lines changed

.github/workflows/cypress.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 92 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,96 @@ env:
1818
KEYCHAIN_PASSWORD: silabs
1919

2020
jobs:
21-
build:
21+
cypress-zigbee:
22+
name: Cypress UI tests with Zigbee data
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
matrix:
26+
node-version: [16.x]
27+
os: [ubuntu-22.04]
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
- name: Use Node.js ${{ matrix.node-version }}
32+
uses: actions/[email protected]
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
cache: 'npm'
36+
- run: sudo ./src-script/install-packages-ubuntu
37+
- run: sudo apt-get install --fix-missing xvfb
38+
- run: npm ci
39+
- run: npm run version-stamp
40+
- run: npm rebuild canvas --update-binary
41+
- run: npm rebuild libxmljs --update-binary
42+
- run: npm run build-spa
43+
- run: xvfb-run -a npm run test:e2e-ci
44+
45+
cypress-matter:
46+
name: Cypress UI tests with Matter data
47+
runs-on: ${{ matrix.os }}
48+
strategy:
49+
matrix:
50+
node-version: [16.x]
51+
os: [ubuntu-22.04]
52+
53+
steps:
54+
- uses: actions/checkout@v3
55+
- name: Use Node.js ${{ matrix.node-version }}
56+
uses: actions/[email protected]
57+
with:
58+
node-version: ${{ matrix.node-version }}
59+
cache: 'npm'
60+
- run: sudo ./src-script/install-packages-ubuntu
61+
- run: sudo apt-get install --fix-missing xvfb
62+
- run: npm ci
63+
- run: npm run version-stamp
64+
- run: npm rebuild canvas --update-binary
65+
- run: npm rebuild libxmljs --update-binary
66+
- run: npm run build-spa
67+
- run: xvfb-run -a npm run test:e2e-matter-ci
68+
69+
generate-and-backend-tests:
70+
name: Generation and back-end tests
71+
runs-on: ${{ matrix.os }}
72+
73+
strategy:
74+
matrix:
75+
node-version: [16.x]
76+
os: [ubuntu-22.04]
77+
78+
steps:
79+
- uses: actions/checkout@v3
80+
- name: Use Node.js ${{ matrix.node-version }}
81+
uses: actions/[email protected]
82+
with:
83+
node-version: ${{ matrix.node-version }}
84+
cache: 'npm'
85+
- run: sudo apt-get update
86+
- run: sudo apt-get install --fix-missing libpixman-1-dev libcairo-dev libsdl-pango-dev libjpeg-dev libgif-dev libxml2-utils
87+
- run: node --version
88+
- run: npm --version
89+
- run: npm ci
90+
- run: npm run metafile-check
91+
- run: npm run version-stamp
92+
- run: npm rebuild canvas --update-binary
93+
- run: npm rebuild libxmljs --update-binary
94+
- run: npm run lic
95+
- run: npm run build-spa
96+
- run: npm run lint
97+
- run: npm run xml-validate
98+
- run: npm run self-check
99+
- run: npm run test:unit
100+
- run: npm run test:gen
101+
102+
build-zap:
103+
name: Build ZAP
104+
needs: [cypress-zigbee, cypress-matter, generate-and-backend-tests]
22105
runs-on: ${{ matrix.os }}
23106

24107
# Platforms to build on/for
25108
strategy:
26109
matrix:
27-
os: [macos-11, ubuntu-latest]
110+
os: [macos-11, ubuntu-22.04]
28111
fail-fast: false
29112

30113
steps:
@@ -231,20 +314,16 @@ jobs:
231314

232315
release:
233316
if: startsWith(github.ref, 'refs/tags/')
234-
needs: [build]
317+
needs: [build-zap]
235318
name: Create Github Release
236-
runs-on: ubuntu-latest
319+
runs-on: ubuntu-22.04
237320
steps:
238321
- uses: actions/download-artifact@v3
239322
- name: List downloaded files
240323
run: ls -R
241324
- name: Creating Github Release
242-
uses: softprops/action-gh-release@v1
243-
with:
244-
generate_release_notes: true
245-
files: |
246-
zap-linux-deb/zap-linux.deb
247-
zap-linux-rpm/zap-linux.rpm
248-
zap-linux-zip/zap-linux.zip
249-
zap-mac-zip/zap-mac.zip
250-
zap-win-zip/zap-win.zip
325+
uses: ncipollo/release-action@v1
326+
with:
327+
generateReleaseNotes: true
328+
prerelease: ${{ endsWith(github.ref, 'nightly') }}
329+
artifacts: 'zap-linux-deb/zap-linux.deb, zap-linux-rpm/zap-linux.rpm, zap-linux-zip/zap-linux.zip, zap-mac-zip/zap-mac.zip, zap-win-zip/zap-win.zip'

.github/workflows/zap.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)