Skip to content

Commit

Permalink
WIP - GitHub Actions CI (#21)
Browse files Browse the repository at this point in the history
* chore(version control): init commit for opening a wip pr

* refactor(.github): moved web-sdk's github actions to root level

all actions now use pnpm instead of yarn, ci now includes a build step.

* ci(.npmrc): added auto-install-peers = true

prevents pnpm install erroring in CI, could potentially be used inline in CI only

* fix(.npmrc): making sure .npmrc is versioned and its rules apply

* refactor(changesets): moved the dependencies and the required scripts to root for changesets
  • Loading branch information
Omri-Levy committed Oct 27, 2022
1 parent 8a52b72 commit a1d5718
Show file tree
Hide file tree
Showing 14 changed files with 1,237 additions and 3,262 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "staging",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/great-seahorses-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'web-sdk': patch
---

moved changesets to root of monorepo
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
name: Build
description: Build the project

runs:
using: composite
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies
shell: bash
run: yarn install --frozen-lockfile

- name: Build
shell: bash
run: yarn build
name: Build
description: Build the project

runs:
using: composite
steps:
- uses: pnpm/action-setup@v2.0.1
with:
version: 7.3.0

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Install dependencies
shell: bash
run: pnpm i --no-frozen-lockfile

- name: Build
shell: bash
run: pnpm build
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
name: Format
description: Format the project

runs:
using: composite
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies
shell: bash
run: yarn install --frozen-lockfile

- name: Format
shell: bash
run: yarn format
name: Format
description: Format the project

runs:
using: composite
steps:
- uses: pnpm/action-setup@v2.0.1
with:
version: 7.3.0

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Install dependencies
shell: bash
run: pnpm i --no-frozen-lockfile

- name: Format
shell: bash
run: pnpm format
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
name: Lint
description: Lint on the project

runs:
using: composite
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies
shell: bash
run: yarn install --frozen-lockfile

- name: Lint
shell: bash
run: yarn lint:fix
name: Lint
description: Lint on the project

runs:
using: composite
steps:
- uses: pnpm/action-setup@v2.0.1
with:
version: 7.3.0

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Install dependencies
shell: bash
run: pnpm i --no-frozen-lockfile

- name: Lint
shell: bash
run: pnpm lint
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
name: Test
description: Test the project

runs:
using: composite
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies
shell: bash
run: yarn install --frozen-lockfile

- name: Test
shell: bash
run: yarn test
name: Test
description: Test the project

runs:
using: composite
steps:
- uses: pnpm/action-setup@v2.0.1
with:
version: 7.3.0

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Install dependencies
shell: bash
run: pnpm i --no-frozen-lockfile

- name: Test
shell: bash
run: pnpm test
21 changes: 11 additions & 10 deletions sdks/web-sdk/.github/workflows/ci.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
# Can be set to specific branches
# Can be configured to a specific branch or a different action than push.
# branches:
# - dev

Expand All @@ -26,6 +26,7 @@ jobs:

- name: Lint
uses: ./.github/actions/lint-action

# test:
# timeout-minutes: 60
# runs-on: ubuntu-latest
Expand All @@ -37,12 +38,12 @@ jobs:
# - name: Test
# uses: ./.github/actions/test-action

# build:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v3
#
# - name: Build
# uses: ./.github/actions/build-action
build:
runs-on: ubuntu-latest

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

- name: Build
uses: ./.github/actions/build-action
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
branches:
- staging
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand All @@ -16,27 +16,25 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.0.1
with:
version: 7.3.0

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
shell: bash
run: yarn install --frozen-lockfile
run: pnpm i --no-frozen-lockfile

- name: Create Release Pull Request
uses: changesets/action@v1
with:
commit: 'chore: release package(s)'
publish: yarn release
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

# Uncomment once we'd like to let CI handle the CDN step
# The CDN path could also be handled using a GitHub secret
# - name: Deploy to CDN
# shell: bash
# run: yarn deploy:cdn:cf
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers=true
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@
"start:workflow-builder:dev": "echo \"Error: no test specified\" && exit 1",
"start:web-ui:dev": "echo \"Error: no test specified\" && exit 1",
"commit": "git add . && git-cz",
"prepare": "husky install"
"prepare": "husky install",
"changeset": "changeset",
"version-packages": "changeset version",
"release": "pnpm build && changeset publish"
},
"license": "ISC",
"devDependencies": {
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@changesets/changelog-git": "^0.1.13",
"@changesets/cli": "^2.25.0",
"cz-conventional-changelog": "^3.3.0",
"commitizen": "^4.2.5",
"editorconfig": "^1.0.1",
"husky": "^8.0.1",
Expand Down
Loading

0 comments on commit a1d5718

Please sign in to comment.