Skip to content

feat: reusable github action workflows #1721

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 1 commit 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
46 changes: 13 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,20 @@ 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
lint:
name: Lint App
uses: ./.github/workflows/lint.yml

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
tests:
name: Tests
uses: ./.github/workflows/test.yml
needs: lint

build-macos:
name: Build macOS (electron-builder)
runs-on: macos-latest
needs: run-unit-tests
needs: tests
if: ${{ !startsWith(github.head_ref, 'release/v') }}

steps:
- uses: actions/checkout@v4
Expand All @@ -71,7 +49,8 @@ jobs:
build-windows:
name: Build Windows (electron-builder)
runs-on: windows-latest
needs: run-unit-tests
needs: tests
if: ${{ !startsWith(github.head_ref, 'release/v') }}

steps:
- uses: actions/checkout@v4
Expand All @@ -95,7 +74,8 @@ jobs:
build-linux:
name: Build Linux (electron-builder)
runs-on: ubuntu-latest
needs: run-unit-tests
needs: tests
if: ${{ !startsWith(github.head_ref, 'release/v') }}

steps:
- uses: actions/checkout@v4
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Lint

on:
workflow_call:

jobs:
lint:
name: 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

12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@ permissions:
contents: write

jobs:
lint:
name: Lint App
uses: ./.github/workflows/lint.yml

tests:
name: Tests
uses: ./.github/workflows/test.yml
needs: lint

release-macos:
name: Publish macOS (electron-builder)
runs-on: macos-latest
needs: tests

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -45,6 +55,7 @@ jobs:
release-windows:
name: Publish Windows (electron-builder)
runs-on: windows-latest
needs: tests

steps:
- uses: actions/checkout@v4
Expand All @@ -71,6 +82,7 @@ jobs:
release-linux:
name: Publish Linux (electron-builder)
runs-on: ubuntu-latest
needs: tests

steps:
- uses: actions/checkout@v4
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test

on:
workflow_call:

jobs:
run-unit-tests:
name: Run Tests
runs-on: macos-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 tsc --noEmit
- run: pnpm test -- --coverage --runInBand --verbose
- name: Coveralls
uses: coverallsapp/github-action@v2

Loading