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

Add visual diffing CI pipeline #1187

Merged
merged 1 commit into from
Aug 28, 2024
Merged
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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8
max_line_length = 88

[*.py]
indent_size = 4
75 changes: 75 additions & 0 deletions .github/workflows/visual-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: "Visual diff"

on:
push:
branches:
- "master"
pull_request:
branches:
- "**"

jobs:
get-node-version:
name: Get Node version
if: (
github.event_name != 'pull_request' && (
github.event_name != 'push' ||
github.actor != 'dependabot[bot]'
)
) || (
github.event_name == 'pull_request' && (
github.event.base.repo.id != github.event.head.repo.id ||
github.actor == 'dependabot[bot]'
)
)
runs-on: ubuntu-latest
outputs:
node-version: ${{ steps.get-node-version.outputs.node-version }}
steps:
- uses: actions/checkout@v4
- name: Check get-node-version version
uses: ./.github/actions/get-node-version
with:
package-json: .github/actions/get-node-version/package.json
- name: Get Node version
id: get-node-version
uses: ./.github/actions/get-node-version
visual-diff:
name: "Generate visual diffs"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup Python 3.10"
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: "Setup Node"
uses: actions/setup-node@v4
with:
node-version: ${{ needs.get-node-version.outputs.node-version }}
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Cache poetry venv
id: cache-poetry
uses: actions/cache@v4
with:
path: tools/visual-diff-ci/.venv
key: "poetry-${{ runner.os }}-\
${{ steps.setup-python.outputs.python-version }}-\
${{ hashFiles('tools/visual-diff-ci/poetry.lock') }}"
restore-keys: |
poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-
- name: Install poetry dependencies
run: |
cd tools/visual-diff-ci/
poetry install
- name: Run visual diffing script
run: |
cd tools/visual-diff-ci/
poetry run python run_ci_script.py
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
1 change: 1 addition & 0 deletions apps/cyberstorm-remix/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
/.cache
/build
.env.development
.env.production
6 changes: 6 additions & 0 deletions tools/cyberstorm-playwright/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
build-storybook.log
3 changes: 3 additions & 0 deletions tools/cyberstorm-playwright/.percy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version: 1
snapshot:
widths: [375, 1200, 1920]
Loading
Loading