From 3cb5c19898641b516e55f5ca3b317ee72592a668 Mon Sep 17 00:00:00 2001 From: csr632 <632882184@qq.com> Date: Sun, 2 Jul 2023 22:16:10 +0800 Subject: [PATCH] update github workflow --- .github/workflows/deploy.yml | 30 ++++++++++++++++++------------ .github/workflows/test.yml | 31 +++++++++++++++++++------------ 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 123413a3..5ac115c7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,30 +13,36 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: pnpm/action-setup@v2.0.1 - with: - version: '7' + - uses: actions/checkout@v3 + - name: Setup Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' + + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 'latest' + run_install: false - - name: Get pnpm cache directory + - name: Get pnpm store directory id: pnpm-cache shell: bash - run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - name: Setup pnpm cache - uses: actions/cache@v3 + - uses: actions/cache@v3 + name: Setup pnpm cache with: - path: ${{ steps.pnpm-cache.outputs.dir }} + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - - name: Install Dependencies + - name: Install dependencies run: pnpm install - name: Build @@ -44,7 +50,7 @@ jobs: - name: Deploy to GitHub Pages if: success() - uses: crazy-max/ghaction-github-pages@v2 + uses: crazy-max/ghaction-github-pages@v3 with: target_branch: gh-pages build_dir: doc-site/dist diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cc09e005..98a81ae1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,38 +22,45 @@ jobs: runs-on: ${{ matrix.os }} # ref: https://playwright.dev/docs/ci#github-actions steps: - - uses: actions/checkout@v2 - - uses: pnpm/action-setup@v2.0.1 - with: - version: '7' + - uses: actions/checkout@v3 + - name: Setup Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' + + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 'latest' + run_install: false - - name: Get pnpm cache directory + - name: Get pnpm store directory id: pnpm-cache shell: bash - run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - name: Setup pnpm cache - uses: actions/cache@v3 + - uses: actions/cache@v3 + name: Setup pnpm cache with: - path: ${{ steps.pnpm-cache.outputs.dir }} + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - - name: Install Dependencies + - name: Install dependencies run: pnpm install + - name: Install Playwright run: pnpm exec playwright install --with-deps ${{ matrix.browser }} - name: Run tests run: pnpm test - name: Upload test results if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: ${{ matrix.browser }}-${{ matrix.os }}-playwright-report path: playwright-report