Skip to content

feat: optimize github action workflows #1720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion .github/workflows/build.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build App
name: CI

on:
push:
Expand All @@ -9,9 +9,42 @@ on:
- main

jobs:
lint-app:
name: Lint (biomejs)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint:check

run-unit-tests:
name: Run Tests
runs-on: macos-latest
needs: lint-app

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- run: pnpm install
- run: pnpm tsc --noEmit
- run: pnpm test -- --coverage --runInBand --verbose
- name: Coveralls
uses: coverallsapp/github-action@v2

build-macos:
name: Build macOS (electron-builder)
runs-on: macos-latest
needs: run-unit-tests

steps:
- uses: actions/checkout@v4
Expand All @@ -38,6 +71,7 @@ jobs:
build-windows:
name: Build Windows (electron-builder)
runs-on: windows-latest
needs: run-unit-tests

steps:
- uses: actions/checkout@v4
Expand All @@ -61,6 +95,7 @@ jobs:
build-linux:
name: Build Linux (electron-builder)
runs-on: ubuntu-latest
needs: run-unit-tests

steps:
- uses: actions/checkout@v4
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/lint.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/pr-triage.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release App
name: Release

on:
push:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Renovate

on:
push:
branches:
- main
paths:
- 'renovate.json'
pull_request:
paths:
- 'renovate.json'

jobs:
renovate-config-validator:
name: Config validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- uses: pnpm/action-setup@v3
with:
run_install: false
- run: pnpm install --global renovate
- name: Validate Renovate config
run: renovate-config-validator
25 changes: 0 additions & 25 deletions .github/workflows/test.yml

This file was deleted.

28 changes: 13 additions & 15 deletions .github/workflows/validator.yml → .github/workflows/triage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: Validators
name: Triage PR

on:
pull_request:
types: [opened, edited, synchronize, reopened]
types: [opened, edited, synchronize, ready_for_review]
branches: [main]

permissions:
contents: read # the config file
pull-requests: write # for labeling pull requests (on: pull_request_target or on: pull_request)
statuses: write # to generate status
checks: write # to generate status

jobs:
pr-lint:
Expand All @@ -28,18 +35,9 @@ jobs:
if (!match.groups.subject) {
core.setFailed('Missing subject in PR title');
}

renovate:
name: Validate Renovate config
labeler:
name: Auto-label PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- uses: pnpm/action-setup@v3
with:
run_install: false
- run: pnpm install --global renovate
- name: Validate Renovate config
run: renovate-config-validator
- uses: fuxingloh/multi-labeler@v4
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Update Website
on:
push:
tags: 'v*'
workflow_dispatch: # For manually verify
workflow_dispatch: # For manually verify website deployment

jobs:
redeploy-website:
Expand Down
Loading