Skip to content

Commit

Permalink
fix: use latest version to run yaml scripts (#17)
Browse files Browse the repository at this point in the history
* feat: support beta tag version for github action

* fix: debug workflow

* feat: update puppeteer demo

* feat: add action for 'run-all'

* chore: use beta tag as default ci choice
  • Loading branch information
yuyutaotao authored Dec 9, 2024
1 parent 94db70d commit 406cb7b
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/playwright-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
description: 'The tag name of @midscene/'
required: true
default: 'latest'
push:
branches:
- main

jobs:
run_script:
Expand All @@ -26,8 +23,8 @@ jobs:
run: |
cd playwright-demo
npm i pnpm -g
pnpm install --no-frozen-lockfile
pnpm i @midscene/web@${{ github.event.inputs.tag }} --save-dev
pnpm install
pnpm run e2e
continue-on-error: true

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/puppeteer-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
description: 'The tag name of @midscene/'
required: true
default: 'latest'
push:
branches:
- main

jobs:
run_script:
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/run-all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Run All Demos

on:
workflow_dispatch:
inputs:
tag:
description: 'The tag name of @midscene/'
required: true
default: 'beta'
push:
branches:
- main

jobs:
trigger_workflows:
runs-on: ubuntu-latest
steps:
- name: Trigger Playwright Demo
uses: actions/github-script@v7
with:
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'playwright-demo.yaml',
ref: context.ref,
inputs: {
tag: '${{ github.event.inputs.tag }}'
}
});
- name: Trigger Puppeteer Demo
uses: actions/github-script@v7
with:
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'puppeteer-demo.yaml',
ref: context.ref,
inputs: {
tag: '${{ github.event.inputs.tag }}'
}
});
- name: Trigger Yaml Scripts Demo
uses: actions/github-script@v7
with:
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'yaml-scripts-demo.yaml',
ref: context.ref,
inputs: {
tag: '${{ github.event.inputs.tag }}'
}
});
3 changes: 0 additions & 3 deletions .github/workflows/yaml-scripts-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
description: 'The tag name of @midscene/'
required: true
default: 'latest'
push:
branches:
- main

jobs:
run_script:
Expand Down
1 change: 1 addition & 0 deletions puppeteer-demo/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Promise.resolve(
(async () => {
const browser = await puppeteer.launch({
headless: true, // 'true' means we can't see the browser window
args: ["--no-sandbox", "--disable-setuid-sandbox"],
});

const page = await browser.newPage();
Expand Down
2 changes: 1 addition & 1 deletion yaml-scripts-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@midscene/cli": "beta"
"@midscene/cli": "latest"
}
}

0 comments on commit 406cb7b

Please sign in to comment.