Skip to content

Commit

Permalink
update github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
csr632 committed Jul 2, 2023
1 parent d26484b commit 3cb5c19
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 24 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,44 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/[email protected]
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
run: pnpm build:docs

- 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
Expand Down
31 changes: 19 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,45 @@ jobs:
runs-on: ${{ matrix.os }}
# ref: https://playwright.dev/docs/ci#github-actions
steps:
- uses: actions/checkout@v2
- uses: pnpm/[email protected]
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

0 comments on commit 3cb5c19

Please sign in to comment.