Skip to content

Commit

Permalink
Add GitHub Actions for continuous integration
Browse files Browse the repository at this point in the history
  • Loading branch information
MicicFilip committed Aug 9, 2024
1 parent 930b57e commit c0779c0
Show file tree
Hide file tree
Showing 23 changed files with 2,367 additions and 5,968 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/chat-widget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Chat Widget

on:
push:
branches: main
pull_request:

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: ${{ github.head_ref }}

- name: Setup Node version
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version-file: '.nvmrc'

- name: Install dependencies
run: npm ci

- name: Lerna - Lint check
run: npm run lint

- name: Lerna - Build
run: npm run build

- run: ls -lha packages/*/
- name: Lerna - Tests
run: npm run test
41 changes: 41 additions & 0 deletions .github/workflows/react.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# name: React - Install and Tests

# on:
# push:
# branches: main
# pull_request:
# paths:
# - 'packages/react/**'
# - '!examples/**'
# - '!packages/sdk/**'
# - '!packages/ui/**'
# - '!storybook/**'

# jobs:
# build:
# runs-on: ubuntu-22.04
# defaults:
# run:
# working-directory: packages/react/
# steps:
# - name: Checkout repository
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
# with:
# ref: ${{ github.head_ref }}

# - name: Setup Node version
# uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
# with:
# node-version-file: '.nvmrc' # Root of the repository.

# # TODO: NPM login instead of auth token?
# - name: Authenticate with private NPM package
# run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

# - run: npm config set install-links=false --workspaces=false
# - name: Install dependencies
# run: npm ci --ignore-scripts

# - run: npm list
# - name: Tests
# run: npm run test
41 changes: 41 additions & 0 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# name: SDK - Install, Lint and Test

# on:
# push:
# branches: main
# pull_request:
# paths:
# - 'packages/sdk/**'
# - '!examples/**'
# - '!packages/react/**'
# - '!packages/ui/**'
# - '!storybook/**'

# jobs:
# build:
# runs-on: ubuntu-22.04
# defaults:
# run:
# working-directory: packages/sdk/
# steps:
# - name: Checkout repository
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
# with:
# ref: ${{ github.head_ref }}

# - name: Setup Node version
# uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
# with:
# node-version-file: '.nvmrc' # Root of the repository.

# - name: Install dependencies
# run: npm ci --ignore-scripts

# - name: Lint check
# run: npm run lint

# - name: Build
# run: npm run build

# - name: Tests
# run: npm run test
67 changes: 67 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Storybook - Install, Lint, Build and GitHub Pages Deploy

on:
push:
branches: main
pull_request:
paths:
- 'storybook/**'
- '!examples/**'
- '!packages/react/**'
- '!packages/sdk/**'
- '!packages/ui/**'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: storybook/
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: ${{ github.head_ref }}

- name: Setup Node version
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version-file: '.nvmrc' # Root of the repository.

# TODO: NPM login instead of auth token?
- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Install dependencies
run: npm ci --ignore-scripts

- name: Lint check
run: npm run lint

- name: Build
run: npm run build-storybook

# We upload the artifact and deploy to GitHub Pages only when this workflow is manually triggered.
- name: Upload pages artifact
if: ${{ github.event_name == 'workflow_dispatch' }}
id: upload-pages-artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
with:
name: storybook
path: storybook/storybook-static/
retention-days: 90

deploy:
needs: build
if: ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-22.04
permissions:
id-token: write
pages: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
with:
artifact_name: storybook
42 changes: 42 additions & 0 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# name: UI - Install, Lint and Test

# on:
# push:
# branches: main
# pull_request:
# paths:
# - 'packages/ui/**'
# - '!examples/**'
# - '!packages/react/**'
# - '!packages/sdk/**'
# - '!storybook/**'

# jobs:
# build:
# runs-on: ubuntu-22.04
# defaults:
# run:
# working-directory: packages/ui/
# steps:
# - name: Checkout repository
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
# with:
# ref: ${{ github.head_ref }}

# - name: Setup Node version
# uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
# with:
# node-version-file: '.nvmrc'

# # TODO: NPM login instead of auth token?
# - name: Authenticate with private NPM package
# run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

# - name: Install dependencies
# run: npm ci --ignore-scripts

# - name: Lint check
# run: npm run lint

# - name: Tests
# run: npm run test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vscode/

node_modules/
coverage/
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"socket.io": "^4.7.5",
"socket.io-client": "^4.7.5",
"ts-node": "^10.9.2",
"typescript": "^5.5.3"
"typescript": "^5.5.4"
}
}
6 changes: 3 additions & 3 deletions examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"devDependencies": {
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"typescript": "^5.2.2",
"typescript": "^5.5.4",
"vite": "^5.3.1"
}
}
Loading

0 comments on commit c0779c0

Please sign in to comment.