Skip to content

Commit 5a9965a

Browse files
authored
feat: optimize github action workflows (#1720)
* feat: optimize github action workflows Signed-off-by: Adam Setch <[email protected]> * feat: optimize github action workflows Signed-off-by: Adam Setch <[email protected]> --------- Signed-off-by: Adam Setch <[email protected]>
1 parent 8539c61 commit 5a9965a

File tree

8 files changed

+78
-84
lines changed

8 files changed

+78
-84
lines changed

.github/workflows/build.yml renamed to .github/workflows/ci.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build App
1+
name: CI
22

33
on:
44
push:
@@ -9,9 +9,42 @@ on:
99
- main
1010

1111
jobs:
12+
lint-app:
13+
name: Lint (biomejs)
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: pnpm/action-setup@v3
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version-file: '.nvmrc'
22+
cache: 'pnpm'
23+
- run: pnpm install
24+
- run: pnpm lint:check
25+
26+
run-unit-tests:
27+
name: Run Tests
28+
runs-on: macos-latest
29+
needs: lint-app
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: pnpm/action-setup@v3
34+
- uses: actions/setup-node@v4
35+
with:
36+
node-version-file: '.nvmrc'
37+
cache: 'pnpm'
38+
- run: pnpm install
39+
- run: pnpm tsc --noEmit
40+
- run: pnpm test -- --coverage --runInBand --verbose
41+
- name: Coveralls
42+
uses: coverallsapp/github-action@v2
43+
1244
build-macos:
1345
name: Build macOS (electron-builder)
1446
runs-on: macos-latest
47+
needs: run-unit-tests
1548

1649
steps:
1750
- uses: actions/checkout@v4
@@ -38,6 +71,7 @@ jobs:
3871
build-windows:
3972
name: Build Windows (electron-builder)
4073
runs-on: windows-latest
74+
needs: run-unit-tests
4175

4276
steps:
4377
- uses: actions/checkout@v4
@@ -61,6 +95,7 @@ jobs:
6195
build-linux:
6296
name: Build Linux (electron-builder)
6397
runs-on: ubuntu-latest
98+
needs: run-unit-tests
6499

65100
steps:
66101
- uses: actions/checkout@v4

.github/workflows/lint.yml

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

.github/workflows/pr-triage.yml

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

.github/workflows/release.yml

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

33
on:
44
push:

.github/workflows/renovate.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Renovate
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'renovate.json'
9+
pull_request:
10+
paths:
11+
- 'renovate.json'
12+
13+
jobs:
14+
renovate-config-validator:
15+
name: Config validation
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version-file: .nvmrc
22+
- uses: pnpm/action-setup@v3
23+
with:
24+
run_install: false
25+
- run: pnpm install --global renovate
26+
- name: Validate Renovate config
27+
run: renovate-config-validator

.github/workflows/test.yml

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

.github/workflows/validator.yml renamed to .github/workflows/triage.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
name: Validators
1+
name: Triage PR
22

33
on:
44
pull_request:
5-
types: [opened, edited, synchronize, reopened]
5+
types: [opened, edited, synchronize, ready_for_review]
6+
branches: [main]
7+
8+
permissions:
9+
contents: read # the config file
10+
pull-requests: write # for labeling pull requests (on: pull_request_target or on: pull_request)
11+
statuses: write # to generate status
12+
checks: write # to generate status
613

714
jobs:
815
pr-lint:
@@ -28,18 +35,9 @@ jobs:
2835
if (!match.groups.subject) {
2936
core.setFailed('Missing subject in PR title');
3037
}
31-
32-
renovate:
33-
name: Validate Renovate config
38+
39+
labeler:
40+
name: Auto-label PR
3441
runs-on: ubuntu-latest
3542
steps:
36-
- uses: actions/checkout@v4
37-
- uses: actions/setup-node@v4
38-
with:
39-
node-version-file: .nvmrc
40-
- uses: pnpm/action-setup@v3
41-
with:
42-
run_install: false
43-
- run: pnpm install --global renovate
44-
- name: Validate Renovate config
45-
run: renovate-config-validator
43+
- uses: fuxingloh/multi-labeler@v4

.github/workflows/website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Update Website
33
on:
44
push:
55
tags: 'v*'
6-
workflow_dispatch: # For manually verify
6+
workflow_dispatch: # For manually verify website deployment
77

88
jobs:
99
redeploy-website:

0 commit comments

Comments
 (0)