Skip to content

Commit

Permalink
Update development workflow (#690)
Browse files Browse the repository at this point in the history
* ci: add new CI job for testing

* chore: remove unused linting before commit

* ci: update testing CI

* ci: update yarn caching logic

* ci: refacor dependency caching logic in ci files
  • Loading branch information
dohooo authored Oct 4, 2024
1 parent 4e5747a commit 3a030b3
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 33 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

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

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn

- name: Install dependencies
run: yarn install

- name: Run tests
run: yarn test

- name: Run linter
run: yarn lint

- name: Check types
run: yarn types
25 changes: 8 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,22 @@ jobs:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: checkout code repository
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: setup node.js
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 18.x
cache: yarn

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
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: install dependencies
run: yarn install && yarn clean && yarn prepare
- name: Install dependencies
run: yarn install

- name: build
run: yarn prepare

- name: Create Release Pull Request or Publish to npm
id: changesets
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,23 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Pages
uses: actions/configure-pages@v3

- uses: actions/setup-node@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
node-version: 18.x
cache: yarn

- uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install

- run: yarn install && yarn clean && yarn prepare
- name: build
run: yarn prepare

- run: cd ./example/app && yarn install && yarn build:web

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "yarn test && yarn lint && yarn types"
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"commitlint": {
Expand Down

0 comments on commit 3a030b3

Please sign in to comment.