g6/.github/workflows/build.yml

61 lines
1.7 KiB
YAML
Raw Normal View History

name: build
2023-08-24 14:42:04 +08:00
on: [push]
2023-08-24 10:17:57 +08:00
concurrency:
group: ${{github.workflow}}-${{github.event_name}}-${{github.ref}}
cancel-in-progress: true
jobs:
2023-08-24 15:11:28 +08:00
lint-and-build-g6:
2023-08-24 10:17:57 +08:00
runs-on: macos-latest
steps:
2023-08-24 15:11:28 +08:00
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
2023-08-24 10:17:57 +08:00
- uses: pnpm/action-setup@v2
2023-08-24 15:11:28 +08:00
name: Install pnpm
2023-08-24 10:17:57 +08:00
with:
2023-08-24 15:11:28 +08:00
version: 8
run_install: false
2023-08-24 15:11:28 +08:00
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
2023-08-24 15:11:28 +08:00
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
2023-08-24 10:17:57 +08:00
2023-08-24 15:44:35 +08:00
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pnpm install --no-frozen-lockfile
- name: Run CI
run: |
cd packages/g6
2023-08-24 10:17:57 +08:00
npm run ci
2023-08-24 14:37:11 +08:00
2023-08-24 10:17:57 +08:00
- name: Workflow failed alert
if: ${{ failure() }}
uses: actions-cool/maintain-one-comment@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
你好, @${{ github.event.pull_request.user.login }} CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复
Hello, @${{ github.event.pull_request.user.login }} CI run failed, please click the [Details] button for detailed log information and fix it.
<!-- Created by actions-cool/maintain-one-comment -->
emojis: 'eyes'
body-include: '<!-- Created by actions-cool/maintain-one-comment -->'