diff --git a/.github/workflows/post-lint-commit-message.yml b/.github/workflows/lint-commit-message-post.yml similarity index 98% rename from .github/workflows/post-lint-commit-message.yml rename to .github/workflows/lint-commit-message-post.yml index fd93700ee5..3050abd6fb 100644 --- a/.github/workflows/post-lint-commit-message.yml +++ b/.github/workflows/lint-commit-message-post.yml @@ -1,8 +1,8 @@ -name: 📮 Post lint commit message +name: 📮 Lint Commit Message Post on: workflow_run: - workflows: ['Lint commit message'] + workflows: ['Lint Commit Message'] types: [completed] jobs: diff --git a/.github/workflows/lint-commit-message.yml b/.github/workflows/lint-commit-message.yml index ccba9631de..138b0a2f5b 100644 --- a/.github/workflows/lint-commit-message.yml +++ b/.github/workflows/lint-commit-message.yml @@ -1,4 +1,4 @@ -name: Lint commit message +name: Lint Commit Message on: pull_request: @@ -8,12 +8,6 @@ jobs: lint: runs-on: ubuntu-latest continue-on-error: true - strategy: - matrix: - node-version: ['16'] - include: - - node-version: '16' - node-name: 'Latest' outputs: failed: ${{ steps.lint_commit.outputs.failed == 'true' }} env: @@ -21,17 +15,14 @@ jobs: steps: - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Add dev branch - run: git branch dev origin/dev + - name: Setup pnpm uses: pnpm/action-setup@v2 - name: Setup node uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: 16 - name: Cache ~/.pnpm-store uses: actions/cache@v3 @@ -47,25 +38,32 @@ jobs: - name: Install dependencies run: pnpm i --frozen-lockfile + - name: Lint commit id: lint_commit run: pnpm lint:commit || echo "::set-output name=failed::true" + - name: Set success result if: ${{ steps.lint_commit.outputs.failed != 'true' }} run: echo 'true' > ./lint-result.txt + - name: Set failed result if: ${{ steps.lint_commit.outputs.failed == 'true' }} run: echo 'false' > ./lint-result.txt + - name: Set PR number run: echo $PULL_REQUEST_NUMBER > pr.txt + - uses: actions/upload-artifact@v3 with: name: commit-lint-report path: ./commit-lint.txt + - uses: actions/upload-artifact@v3 with: name: commit-lint-result path: ./lint-result.txt + - uses: actions/upload-artifact@v3 with: name: pr-number diff --git a/.github/workflows/test-ssr.yml b/.github/workflows/test-ssr.yml index 02ef84c8be..c0b61dc150 100644 --- a/.github/workflows/test-ssr.yml +++ b/.github/workflows/test-ssr.yml @@ -1,19 +1,16 @@ -# This workflow runs on target, so there is no need to worry about secrets - name: 🧪 Test SSR on: pull_request +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + jobs: - # Build successfully, start deployment test: name: SSR rendering test runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x] - steps: - uses: actions/checkout@v3 with: @@ -26,7 +23,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: 16 cache: 'pnpm' - name: Install dependencies @@ -37,5 +34,5 @@ jobs: env: NODE_OPTIONS: --max-old-space-size=4096 - - name: Do test + - name: Test run: pnpm test:ssr diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 5726d239e5..a75363efa2 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -1,5 +1,3 @@ -# Unit Test - name: 🧪 Unit Test on: pull_request @@ -9,15 +7,9 @@ concurrency: cancel-in-progress: true jobs: - build: - name: Unit Test (${{ matrix.node-name }}) + lint: + name: Lint runs-on: ubuntu-latest - strategy: - matrix: - node-version: ['16'] - include: - - node-version: '16' - node-name: 'Latest' steps: - uses: actions/checkout@v3 @@ -33,7 +25,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: 16 cache: 'pnpm' - name: Install dependencies @@ -45,5 +37,30 @@ jobs: - name: Type Check run: pnpm typecheck + build: + name: Unit Test (${{ matrix.node-name }}) + runs-on: ubuntu-latest + strategy: + matrix: + node-version: ['16'] + include: + - node-version: '16' + node-name: 'Latest' + + steps: + - uses: actions/checkout@v3 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install dependencies + run: pnpm i --frozen-lockfile + - name: Test run: pnpm test