Skip to content

Commit 17298f0

Browse files
Add build checks and improve existing CI/CD checks
Run quality checks for every possible OS because behavior of linting rules may change per OS (e.g. `linebreak-style` ESLint assertment varies by Unix-like vs Windows). Add a new check to ensure project can be built: 1. As both web and desktop applications. Different jobs are used due to nonidentical environment/mode support. Reference: nklayman/vue-cli-plugin-electron-builder#1627. 2. Targeting all possible modes. The modes are configured using `--mode` but electron CLI checks `NODE_ENV` so it's set as well. Reference: nklayman/vue-cli-plugin-electron-builder#1626. 3. On and for different operating systems. Fix typo "Run units" instead of "Run unit tests". Link to specific GitHub actions page for workflow runs. Update documentation to match new structure, and change nontransparent icons from the diagram and consistently use imperative for actions. Rename `release-site` , `release-git`, `release-desktop` to `site-release` , `git-release` and `desktop-release` to not be Yoda.
1 parent 61b475f commit 17298f0

9 files changed

+84
-18
lines changed

.github/workflows/checks.build.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: build-checks
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build-web:
9+
strategy:
10+
matrix:
11+
os: [ macos, ubuntu, windows ]
12+
mode: [ development, test, production ]
13+
fail-fast: false # Allows to see results from other combinations
14+
runs-on: ${{ matrix.os }}-latest
15+
steps:
16+
-
17+
name: Checkout
18+
uses: actions/checkout@v2
19+
-
20+
name: Setup node
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: 15.x
24+
-
25+
name: Install dependencies
26+
run: npm ci
27+
-
28+
name: Build
29+
run: npm run build -- --mode ${{ matrix.mode }}
30+
31+
# A new job is used due to environments/modes different from Vue CLI, https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1626
32+
build-desktop:
33+
strategy:
34+
matrix:
35+
os: [ macos, ubuntu, windows ]
36+
mode: [ development, production ] # "test" is not supported https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1627
37+
fail-fast: false # Allows to see results from other combinations
38+
runs-on: ${{ matrix.os }}-latest
39+
steps:
40+
-
41+
name: Checkout
42+
uses: actions/checkout@v2
43+
-
44+
name: Setup node
45+
uses: actions/setup-node@v1
46+
with:
47+
node-version: 15.x
48+
-
49+
name: Install dependencies
50+
run: npm ci
51+
-
52+
name: Install cross-env
53+
# Used to set NODE_ENV due to https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1626
54+
run: npm install --global cross-env
55+
-
56+
name: Build
57+
run: |-
58+
cross-env-shell NODE_ENV=${{ matrix.mode }}
59+
npm run electron:build -- --publish never --mode ${{ matrix.mode }}

.github/workflows/checks.quality.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
- npm run lint:md
1414
- npm run lint:md:relative-urls
1515
- npm run lint:md:consistency
16-
fail-fast: false # So it continues with other commands if one fails
16+
os: [ macos, ubuntu, windows ]
17+
fail-fast: false # Still interested to see results from other combinations
1718
steps:
1819
- name: Checkout
1920
uses: actions/checkout@v2

.github/workflows/release.desktop.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: desktop-release
1+
name: release-desktop
22

33
on:
44
release:

.github/workflows/release.git.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: git-release
1+
name: release-git
22

33
on:
44
push: # Ensure a new release is created for each new tag

.github/workflows/release.site.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: site-release
1+
name: release-site
22

33
on:
44
release:

.github/workflows/tests.unit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ jobs:
2424
name: Install dependencies
2525
run: npm ci
2626
-
27-
name: Run units
27+
name: Run unit tests
2828
run: npm run test:unit

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,58 +24,64 @@
2424
src="https://api.codeclimate.com/v1/badges/3a70b7ef602e2264342c/maintainability"
2525
/>
2626
</a>
27-
<!-- Code quality -->
27+
<!-- Tests -->
2828
<br />
29-
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
29+
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/tests.unit.yaml">
3030
<img
3131
alt="Unit tests status"
3232
src="https://github.com/undergroundwires/privacy.sexy/workflows/unit-tests/badge.svg"
3333
/>
3434
</a>
35-
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
35+
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/tests.integration.yaml">
3636
<img
3737
alt="Integration tests status"
3838
src="https://github.com/undergroundwires/privacy.sexy/workflows/integration-tests/badge.svg"
3939
/>
4040
</a>
41-
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
41+
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/tests.e2e.yaml">
4242
<img
4343
alt="E2E tests status"
4444
src="https://github.com/undergroundwires/privacy.sexy/workflows/e2e-tests/badge.svg"
4545
/>
4646
</a>
4747
<!-- Checks -->
4848
<br />
49-
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
49+
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/checks.quality.yaml">
5050
<img
5151
alt="Quality checks status"
5252
src="https://github.com/undergroundwires/privacy.sexy/workflows/quality-checks/badge.svg"
5353
/>
5454
</a>
55-
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
55+
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/checks.security.yaml">
5656
<img
5757
alt="Security checks status"
5858
src="https://github.com/undergroundwires/privacy.sexy/workflows/security-checks/badge.svg"
5959
/>
6060
</a>
61+
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/checks.build.yaml">
62+
<img
63+
alt="Build checks status"
64+
src="https://github.com/undergroundwires/privacy.sexy/workflows/build-checks/badge.svg"
65+
/>
66+
</a>
6167
<!-- Release -->
6268
<br />
63-
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
69+
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/release.git.yaml">
6470
<img
6571
alt="Git release status"
66-
src="https://github.com/undergroundwires/privacy.sexy/workflows/git-release/badge.svg"
72+
src="https://github.com/undergroundwires/privacy.sexy/workflows/release-git/badge.svg"
6773
/>
6874
</a>
69-
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
75+
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/release.site.yaml">
7076
<img
7177
alt="Site release status"
72-
src="https://github.com/undergroundwires/privacy.sexy/workflows/site-release/badge.svg"
78+
src="https://github.com/undergroundwires/privacy.sexy/workflows/release-site/badge.svg"
7379
/>
7480
</a>
75-
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
81+
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/release.desktop.yaml">
7682
<img
7783
alt="Desktop application release status"
78-
src="https://github.com/undergroundwires/privacy.sexy/workflows/desktop-release/badge.svg"
84+
src="https://github.com/undergroundwires/privacy.sexy/workflows/release-desktop/badge.svg"
7985
/>
8086
</a>
8187
<!-- Others -->

img/architecture/gitops.drawio

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

img/architecture/gitops.png

-376 KB
Loading

0 commit comments

Comments
 (0)