ant-design/.github/workflows/site-test.yml
2c83c308ea
ci: fix workflow artifact download path error (#45141)
Signed-off-by: 红 <wxh1220@gmail.com>
2023-09-30 09:42:48 +08:00

48 lines
1.2 KiB
YAML

name: Site E2E Test
on:
workflow_run:
workflows: ["Preview Build"]
types:
- completed
permissions:
contents: read
jobs:
e2e-test:
permissions:
actions: read # for dawidd6/action-download-artifact to query and download artifacts
name: E2E Test
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: checkout
uses: actions/checkout@v4
- name: restore cache from package-lock.json
uses: actions/cache@v3
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v3
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
# Download site artifact
- name: download site artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
name: site
path: _site
- name: Run E2E Test
run: npm run site:test