Skip to content

Commit

Permalink
Add build checks and improve existing CI/CD checks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
undergroundwires committed Dec 30, 2021
1 parent db194b5 commit 08b531f
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 18 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/checks.build.yaml
@@ -0,0 +1,59 @@
name: build-checks

on:
push:
pull_request:

jobs:
build-web:
strategy:
matrix:
os: [ macos, ubuntu, windows ]
mode: [ development, test, production ]
fail-fast: false # Allows to see results from other combinations
runs-on: ${{ matrix.os }}-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Setup node
uses: actions/setup-node@v1
with:
node-version: 15.x
-
name: Install dependencies
run: npm ci
-
name: Build
run: npm run build -- --mode ${{ matrix.mode }}

# A new job is used due to environments/modes different from Vue CLI, https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1626
build-desktop:
strategy:
matrix:
os: [ macos, ubuntu, windows ]
mode: [ development, production ] # "test" is not supported https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1627
fail-fast: false # Allows to see results from other combinations
runs-on: ${{ matrix.os }}-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Setup node
uses: actions/setup-node@v1
with:
node-version: 15.x
-
name: Install dependencies
run: npm ci
-
name: Install cross-env
# Used to set NODE_ENV due to https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1626
run: npm install --global cross-env
-
name: Build
run: |-
cross-env-shell NODE_ENV=${{ matrix.mode }}
npm run electron:build -- --publish never --mode ${{ matrix.mode }}
3 changes: 2 additions & 1 deletion .github/workflows/checks.quality.yaml
Expand Up @@ -13,7 +13,8 @@ jobs:
- npm run lint:md
- npm run lint:md:relative-urls
- npm run lint:md:consistency
fail-fast: false # So it continues with other commands if one fails
os: [ macos, ubuntu, windows ]
fail-fast: false # Still interested to see results from other combinations
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.desktop.yaml
@@ -1,4 +1,4 @@
name: desktop-release
name: release-desktop

on:
release:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.git.yaml
@@ -1,4 +1,4 @@
name: git-release
name: release-git

on:
push: # Ensure a new release is created for each new tag
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.site.yaml
@@ -1,4 +1,4 @@
name: site-release
name: release-site

on:
release:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.unit.yaml
Expand Up @@ -24,5 +24,5 @@ jobs:
name: Install dependencies
run: npm ci
-
name: Run units
name: Run unit tests
run: npm run test:unit
30 changes: 18 additions & 12 deletions README.md
Expand Up @@ -24,58 +24,64 @@
src="https://api.codeclimate.com/v1/badges/3a70b7ef602e2264342c/maintainability"
/>
</a>
<!-- Code quality -->
<!-- Tests -->
<br />
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/tests.unit.yaml">
<img
alt="Unit tests status"
src="https://github.com/undergroundwires/privacy.sexy/workflows/unit-tests/badge.svg"
/>
</a>
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/tests.integration.yaml">
<img
alt="Integration tests status"
src="https://github.com/undergroundwires/privacy.sexy/workflows/integration-tests/badge.svg"
/>
</a>
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/tests.e2e.yaml">
<img
alt="E2E tests status"
src="https://github.com/undergroundwires/privacy.sexy/workflows/e2e-tests/badge.svg"
/>
</a>
<!-- Checks -->
<br />
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/checks.quality.yaml">
<img
alt="Quality checks status"
src="https://github.com/undergroundwires/privacy.sexy/workflows/quality-checks/badge.svg"
/>
</a>
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/checks.security.yaml">
<img
alt="Security checks status"
src="https://github.com/undergroundwires/privacy.sexy/workflows/security-checks/badge.svg"
/>
</a>
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/checks.build.yaml">
<img
alt="Build checks status"
src="https://github.com/undergroundwires/privacy.sexy/workflows/build-checks/badge.svg"
/>
</a>
<!-- Release -->
<br />
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/release.git.yaml">
<img
alt="Git release status"
src="https://github.com/undergroundwires/privacy.sexy/workflows/git-release/badge.svg"
src="https://github.com/undergroundwires/privacy.sexy/workflows/release-git/badge.svg"
/>
</a>
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/release.site.yaml">
<img
alt="Site release status"
src="https://github.com/undergroundwires/privacy.sexy/workflows/site-release/badge.svg"
src="https://github.com/undergroundwires/privacy.sexy/workflows/release-site/badge.svg"
/>
</a>
<a href="https://github.com/undergroundwires/privacy.sexy/actions">
<a href="https://github.com/undergroundwires/privacy.sexy/actions/workflows/release.desktop.yaml">
<img
alt="Desktop application release status"
src="https://github.com/undergroundwires/privacy.sexy/workflows/desktop-release/badge.svg"
src="https://github.com/undergroundwires/privacy.sexy/workflows/release-desktop/badge.svg"
/>
</a>
<!-- Others -->
Expand Down
2 changes: 1 addition & 1 deletion img/architecture/gitops.drawio

Large diffs are not rendered by default.

Binary file modified img/architecture/gitops.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 08b531f

Please sign in to comment.