Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AsPulse committed Dec 11, 2023
1 parent e74a3fc commit 7527157
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 14 deletions.
23 changes: 23 additions & 0 deletions .github/actions/setup-node/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Setup node
description: "Setup pnpm, Node.js."
inputs:
node-version:
description: "Version of Node.js using setup."
default: "20"
required: false

runs:
using: composite
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install packages
shell: sh
run: pnpm install --frozen-lockfile

19 changes: 8 additions & 11 deletions .github/actions/setup-turbo/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@ name: Setup turbo
description: "Setup pnpm, Node.js, turborepo and its own remote-caching server."
inputs:
node-version:
description: "version of Node.js using setup."
description: "Version of Node.js using setup. This is also used as a cache key for turbo-remote-cache-server."
default: "20"
required: false
turbo-cache-key:
description: "Cache key for turbo-remote-cache-server."
required: true

runs:
using: composite
steps:
- name: Launch Turbo Remote Cache Server
uses: dtinth/setup-github-actions-caching-for-turbo@v1.1.0
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
cache-prefix: turbogha_${{ inputs.turbo-cache-key }}_node${{ inputs.node-version }}
- name: Setup node
uses: ./.github/actions/setup-node
with:
node-version: ${{ inputs.node-version }}
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install packages
shell: sh
run: pnpm install --frozen-lockfile

18 changes: 18 additions & 0 deletions .github/workflows/deps-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: deps-check

on:
push:
branches: [main]
pull_request:

permissions: read-all

jobs:
manypkg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Run manypkg
run: pnpm manypkg check
10 changes: 7 additions & 3 deletions .github/workflows/format-and-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: format-and-lint
on:
push:
branches: [main]
pull_request_target:
pull_request:

permissions: read-all

Expand All @@ -12,15 +12,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-turbo
- name: Setup turbo
uses: ./.github/actions/setup-turbo
with:
turbo-cache-key: prettier
- name: Run Prettier
run: pnpm run format:check

eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-turbo
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Run ESLint
run: pnpm run lint

0 comments on commit 7527157

Please sign in to comment.