Skip to content

Commit

Permalink
👷 ci: Created GitHub Actions workflows to lint, format, and typecheck
Browse files Browse the repository at this point in the history
note: ty julius, awesome stuff!
  • Loading branch information
aryanprince committed Feb 11, 2024
1 parent ce8235e commit bfd1835
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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' }}

# You can leverage Vercel Remote Caching with Turbo to speed up your builds
# @link https://turborepo.org/docs/core-concepts/remote-caching#remote-caching-on-vercel-builds
env:
FORCE_COLOR: 3
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}

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
3 changes: 3 additions & 0 deletions tooling/github/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "@campus-hub/github"
}
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: 18
cache: "pnpm"

- shell: bash
run: pnpm add -g turbo

- shell: bash
run: pnpm install

0 comments on commit bfd1835

Please sign in to comment.