Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
shihanwan committed Apr 17, 2024
1 parent 710ef93 commit 034cc10
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
pull_request:
branches: ["*"]
push:
branches: ["main"]
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup
uses: ./tooling/github/setup

- name: Copy env
shell: bash
run: cp .env.example .env

- name: Lint
run: pnpm lint && pnpm lint:ws

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup
uses: ./tooling/github/setup

- name: Format
run: pnpm format

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup
uses: ./tooling/github/setup

- name: Typecheck
run: pnpm typecheck

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

- name: Setup
uses: ./tooling/github/setup

- name: Test
run: pnpm test
17 changes: 17 additions & 0 deletions tooling/github/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Setup and install"
description: "Common setup steps for Actions"

runs:
using: composite
steps:
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: 21
cache: "pnpm"

- shell: bash
run: pnpm add -g turbo

- shell: bash
run: pnpm install

0 comments on commit 034cc10

Please sign in to comment.