Skip to content

Commit

Permalink
Chore: CI - Run each packages
Browse files Browse the repository at this point in the history
  • Loading branch information
black7375 committed Nov 8, 2023
1 parent 862dabf commit 56701af
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/actions/node-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Setup"

runs:
using: "composite"
steps:
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
# https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
shell: bash

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Package Install
run: yarn install --immutable
shell: bash
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

# This action works with pull requests and pushes
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/node-setup

- name: Test
run: yarn test:all
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Turborepo
.turbo
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
"packages/*"
],
"scripts": {
"clean": "turbo run clean",
"build": "turbo run build",
"lint": "turbo run lint",
"fix": "turbo run fix",
"check": "turbo run check",
"check:all": "turbo run check:all",
"test": "turbo run test",
"test:all": "turbo run test:all",
"coverage": "turbo run coverage",
"coverage:all": "turbo run coverage:all",
"g:clean": "cd $INIT_CWD && yarn run -T rimraf dist coverage .turbo tsconfig.tsbuildinfo node_modules/.vite",
"g:build": "cd $INIT_CWD && yarn run -T vite build",
"g:build-watch": "cd $INIT_CWD && yarn run build --watch",
Expand All @@ -24,6 +34,7 @@
"@vitest/coverage-v8": "^0.34.6",
"c8": "^8.0.1",
"rimraf": "^5.0.5",
"turbo": "^1.10.16",
"typescript": "^5.2.2",
"vite": "^4.5.0",
"vitest": "^0.34.6"
Expand Down
40 changes: 40 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "https://turborepo.org/schema.json",
"baseBranch": "origin/main",
"pipeline": {
"clean": {
"cache": false
},
"build": {
"dependsOn": ["^build"],
"inputs": ["src/**/*.ts", "vite.config.ts"],
"outputs": ["dist/**"]
},
"lint": {
},
"fix": {
},
"check": {
"dependsOn": ["^build"],
"outputs": ["tsconfig.tsbuildinfo"]
},
"check:all": {
"dependsOn": ["lint", "check"]
},
"test": {
"dependsOn": ["^build"],
"inputs": ["src/**/*.ts", "__test__/**/*.ts", "vite.config.ts"]
},
"test:all": {
"dependsOn": ["build", "test", "check:all"]
},
"coverage": {
"dependsOn": ["^build"],
"inputs": ["src/**/*.ts", "__test__/**/*.ts", "vite.config.ts"],
"outputs": ["coverage/**"]
},
"coverage:all": {
"dependsOn": ["build", "coverage", "check:all"]
}
}
}
72 changes: 72 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3061,6 +3061,7 @@ __metadata:
rimraf: ^5.0.5
terser: ^5.24.0
tslib: ^2.6.2
turbo: ^1.10.16
typescript: ^5.2.2
vite: ^4.5.0
vitest: ^0.34.6
Expand Down Expand Up @@ -4162,6 +4163,77 @@ __metadata:
languageName: node
linkType: hard

"turbo-darwin-64@npm:1.10.16":
version: 1.10.16
resolution: "turbo-darwin-64@npm:1.10.16"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"turbo-darwin-arm64@npm:1.10.16":
version: 1.10.16
resolution: "turbo-darwin-arm64@npm:1.10.16"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"turbo-linux-64@npm:1.10.16":
version: 1.10.16
resolution: "turbo-linux-64@npm:1.10.16"
conditions: os=linux & cpu=x64
languageName: node
linkType: hard

"turbo-linux-arm64@npm:1.10.16":
version: 1.10.16
resolution: "turbo-linux-arm64@npm:1.10.16"
conditions: os=linux & cpu=arm64
languageName: node
linkType: hard

"turbo-windows-64@npm:1.10.16":
version: 1.10.16
resolution: "turbo-windows-64@npm:1.10.16"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"turbo-windows-arm64@npm:1.10.16":
version: 1.10.16
resolution: "turbo-windows-arm64@npm:1.10.16"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"turbo@npm:^1.10.16":
version: 1.10.16
resolution: "turbo@npm:1.10.16"
dependencies:
turbo-darwin-64: 1.10.16
turbo-darwin-arm64: 1.10.16
turbo-linux-64: 1.10.16
turbo-linux-arm64: 1.10.16
turbo-windows-64: 1.10.16
turbo-windows-arm64: 1.10.16
dependenciesMeta:
turbo-darwin-64:
optional: true
turbo-darwin-arm64:
optional: true
turbo-linux-64:
optional: true
turbo-linux-arm64:
optional: true
turbo-windows-64:
optional: true
turbo-windows-arm64:
optional: true
bin:
turbo: bin/turbo
checksum: 69d1892593449b264e0bd48b851317a743016ab62cf470e7293b2cc3781240e863c48232c89f65a5a4ce97eb791ca550b201593449350da073db07703a19cfa5
languageName: node
linkType: hard

"type-check@npm:^0.4.0, type-check@npm:~0.4.0":
version: 0.4.0
resolution: "type-check@npm:0.4.0"
Expand Down

0 comments on commit 56701af

Please sign in to comment.