Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: wip user-flows with puppeteer replay #6

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/actions/replay/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:iron-alpine

RUN npm install -g puppeteer @puppeteer/replay
RUN puppeteer browsers install chrome

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

11 changes: 11 additions & 0 deletions .github/actions/replay/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh -l

read -d '' COMMAND <<-EOF
if [ -f "$HOME/ignore" ] && grep "^ignore:$BUILD_DIR" "$HOME/ignore"; then
echo "$BUILD_DIR didn't change"
else
${BUILD_COMMAND:-echo} && npx @puppeteer/replay $*
fi
EOF

OUTPUT=$(sh -c "$COMMAND")
2 changes: 1 addition & 1 deletion .github/actions/setup-install/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
pnpm-version:
description: 'Version of pnpm'
required: false
default: '7.18.0'
default: '8.5.1'

runs:
using: "composite"
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/on_prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ jobs:
uses: ./.github/actions/affected
id: checkForAffected

replay:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup & Install
uses: ./.github/actions/setup-install

- uses: browser-actions/setup-chrome@v1
id: setup-chrome

- run: node node_modules/@puppeteer/replay/lib/cli.js user-flows

articles-app:
needs: [affected]
if: contains(needs.affected.outputs.affected, 'articles-app')
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@
"@gang-of-front/cli": "1.4.2",
"husky": "8.0.3",
"nx": "16.1.4"
},
"dependencies": {
"@puppeteer/replay": "^3.0.0",
"puppeteer": "22.0.0"
}
}
Loading
Loading