Skip to content

Commit

Permalink
feat: reusable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelfimov committed Jan 30, 2024
1 parent d7f649c commit ea13ed3
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 29 deletions.
35 changes: 6 additions & 29 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,9 @@ name: Checks
on: [pull_request]

jobs:
run:
name: Run
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.13'

- name: Install
run: yarn install

- name: Lint
run: yarn checks lint
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: TypeCheck
run: yarn checks typecheck
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: Release
run: yarn checks release
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
check:
name: Lint, typecheck
uses: ./.github/workflows/reusable-checks.yaml
release:
name: Release
uses: ./.github/workflows/reusable-release.yaml
30 changes: 30 additions & 0 deletions .github/workflows/reusable-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Reusable checks

on:
workflow_call:

jobs:
checks:
name: Lint, typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18.19'

- name: Install
run: yarn install

- name: Lint
run: yarn checks lint
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: TypeCheck
run: yarn checks typecheck
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
25 changes: 25 additions & 0 deletions .github/workflows/reusable-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Reusable release

on:
workflow_call:

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18.19'

- name: Install
run: yarn install

- name: Release
run: yarn checks release
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
29 changes: 29 additions & 0 deletions .github/workflows/reusable-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Reusable tests

on:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18.19'

- name: Install
run: yarn install

- name: Test unit
run: yarn checks test unit
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: Test integration
run: yarn checks test integration
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

0 comments on commit ea13ed3

Please sign in to comment.