Skip to content

Commit

Permalink
ci: update ci workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Chia1104 committed Jul 22, 2023
1 parent 38ec2d0 commit ac85bcc
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 51 deletions.
23 changes: 23 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"🎨 package: ui":
- any: ["packages/ui/**"]

"✏️ package: ui-utils":
- any: ["packages/ui-utils/**"]

"🔨 package: utils":
- any: ["packages/utils/**"]

"🔧 package: tailwind-config":
- any: ["packages/tailwind-config/**"]

"🧰 package: tsconfig":
- any: ["packages/tsconfig/**"]

"📦 package":
- any: ["packages/**"]

"🚀 docs":
- any: ["apps/docs/**"]

"🎮 playground":
- any: ["playground/**"]
33 changes: 33 additions & 0 deletions .github/workflows/clean-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: cleanup caches by a branch
on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Pull Request Labeler'
on:
- pull_request_target

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
53 changes: 53 additions & 0 deletions .github/workflows/ui-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: UI CI

on:
push:
branches: [ main ]
pull_request:
types: [ opened, labeled, unlabeled, synchronize ]
paths:
- "packages/ui/**"
- "packages/utils/**"
- "packages/ui-utils/**"
- ".github/workflows/ui-ci.yml"
- "package.json"

env:
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}

jobs:
build:
name: Build and Test
timeout-minutes: 15
runs-on: ubuntu-latest

steps:
- name: '🐙️ Check out code'
uses: actions/checkout@v3

- name: '💽️ Init'
id: init
uses: './.github/actions/init-pnpm'

- name: '📦 Install'
id: install
uses: './.github/actions/pnpm-install'
with:
INSTALL_COMMAND: '--filter "@chiastack/*" --filter root'

- name: '🏗️ Build'
id: build
uses: './.github/actions/pnpm-build'
with:
BUILD_COMMAND: 'build --filter @chiastack/ui...'
TURBO_TEAM: ${{ env.TURBO_TEAM }}
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}

- name: '🚨️ ESLint, Type checking, Unit tests'
id: lint-test
uses: './.github/actions/lint-test'
with:
COMMAND: '--filter @chiastack/ui...'
TURBO_TEAM: ${{ env.TURBO_TEAM }}
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
94 changes: 47 additions & 47 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

1 comment on commit ac85bcc

@vercel
Copy link

@vercel vercel bot commented on ac85bcc Jul 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./apps/docs

chia-stack-docs.vercel.app
docs-chia-stack.vercel.app
docs-git-main-chia-stack.vercel.app

Please sign in to comment.