Skip to content

Commit

Permalink
ci: added workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
fieztazica committed May 14, 2024
1 parent b90df6a commit 42ba88b
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Build

on:
# push:
# branches: ['master', 'main', 'dev']
pull_request:
branches: ['master', 'main', 'dev']

# allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# allow the workflow to be re-used in other workflows
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Turbo build
run: pnpm run build
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
push:
branches: ['master', 'main', 'dev']
pull_request:
branches: ['master', 'main', 'dev']

# allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# allow the workflow to be re-used in other workflows
workflow_call:

jobs:
type-check:
uses: ./github/workflows/type-check.yml
lint:
uses: ./github/workflows/lint.yml
test:
uses: ./github/workflows/test.yml
build:
uses: ./.github/workflows/build.yml
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: ESLint

on:
push:
branches: ['master', 'main', 'dev']
pull_request:
branches: ['master', 'main', 'dev']

# allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: API/Lint
run: pnpm --filter=api run lint
- name: Refine/Lint
run: pnpm --filter=refine run lint
- name: Web/Lint
run: pnpm --filter=web run lint
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Test

on:
push:
branches: ['master', 'main', 'dev']
pull_request:
branches: ['master', 'main', 'dev']

# allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Test API with Jest
run: pnpm --filter=api run test
35 changes: 35 additions & 0 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Types

on:
push:
branches: ['master', 'main', 'dev']
pull_request:
branches: ['master', 'main', 'dev']

# allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Do check
run: pnpm run type-check

0 comments on commit 42ba88b

Please sign in to comment.