Skip to content

Commit

Permalink
Merge pull request #9 from Jay-Karia/chore/ci-cd-setup
Browse files Browse the repository at this point in the history
chore: add ci and cd
  • Loading branch information
Jay-Karia authored Nov 24, 2024
2 parents 79c80eb + 9673e92 commit 632cfd7
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 1,251 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build-root:
if: github.workspace == '.'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- run: npm run build

build-playground:
if: contains(github.event.head_commit.modified, 'playground/') || contains(github.event.pull_request.changed_files, 'playground/')
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./playground
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: './playground/package-lock.json'
- run: npm ci
- run: npm run build

build-docs:
if: contains(github.event.head_commit.modified, 'docs/') || contains(github.event.pull_request.changed_files, 'docs/')
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: './docs/package-lock.json'
- run: npm ci
- run: npm run build
19 changes: 19 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CodeQL

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '30 1 * * 0'

jobs:
analyze:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- uses: actions/checkout@v3
- uses: github/codeql-action/init@v2
- uses: github/codeql-action/analyze@v2
68 changes: 68 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Linter

on:
push:
paths:
- '**.ts'
- '**.tsx'
- '**.js'
- '**.jsx'
- 'package.json'
- '.eslintrc.*'
- 'playground/**'
- 'docs/**'
pull_request:
paths:
- '**.ts'
- '**.tsx'
- '**.js'
- '**.jsx'
- 'package.json'
- '.eslintrc.*'
- 'playground/**'
- 'docs/**'

jobs:
lint-root:
if: github.workspace == '.'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- run: npm run lint

lint-playground:
if: contains(github.event.head_commit.modified, 'playground/') || contains(github.event.pull_request.changed_files, 'playground/')
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./playground
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: './playground/package-lock.json'
- run: npm ci
- run: npm run lint

lint-docs:
if: contains(github.event.head_commit.modified, 'docs/') || contains(github.event.pull_request.changed_files, 'docs/')
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: './docs/package-lock.json'
- run: npm ci
- run: npm run lint
20 changes: 20 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
if: github.workspace == '.'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- run: npm run test
1 change: 0 additions & 1 deletion playground/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { NextConfig } from "next";
import MillionLint from "@million/lint";

const nextConfig: NextConfig = {
/* config options here */
Expand Down
1 change: 0 additions & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"check-types": "tsc --noEmit"
},
"dependencies": {
"@million/lint": "^1.0.12",
"@monaco-editor/react": "^4.6.0",
"@radix-ui/react-icons": "^1.3.1",
"@radix-ui/react-scroll-area": "^1.2.0",
Expand Down
Loading

0 comments on commit 632cfd7

Please sign in to comment.