Skip to content

Commit

Permalink
chore: integrate cypress, playwright and puppeteer packages (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge authored Oct 8, 2023
1 parent bc295e8 commit f2f4d2a
Show file tree
Hide file tree
Showing 54 changed files with 5,617 additions and 378 deletions.
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Report a bug that you encounter
title: "Bug: "
labels: bug
assignees: ""
---

## Bug description

Describe the bug, context and use case.

### Correct behavior expected

Describe the correct behavior you expect to happen if there is no bug.

### Wrong behavior observed

Describe the wrong behavior that happen because of the bug.

### Screenshot

_Optional:_ Add a screenshot to help explain the problem.

## Reproduce

Describe a way to reproduce the bug.

You can share a code snippet or give a step by step guide.

## Setup

Describe the setup you have when you encounter the bug : device, browser, library version...

## Additional information

Add any other information that can help us understand the bug or fix it.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Feature request
about: Suggest an idea for this project
title: "Feat: "
labels: "enhancement"
assignees: ""
---

<!-- Rephrase the feature as a user story format : -->

As a [user|client|developer], I would like to ...

## Description

Describe the feature, context and use case.
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Description

Please explain the changes you made here.

## Type of changes

Select the correct labels: `bug`, `enhancement` or `documentation`.

## Checklist

Valid all before asking for a code review to `argos-ci/code` :

- [ ] I have read the CONTRIBUTING doc
- [ ] The commits message follows the [Conventional Commits' policy](https://www.conventionalcommits.org/)
- [ ] Lint and unit tests pass locally
- [ ] I have added tests if needed

Optional checks:

- [ ] My changes requires a change to the documentation
- [ ] I have updated the documentation accordingly

## Further comments

*Optional* : Feel free to explain your motivation, share useful information or a feature screenshot.
33 changes: 33 additions & 0 deletions .github/actions/setup-playwright/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Setup Playwright"
description: "Install Playwright and dependencies"
runs:
using: "composite"
steps:
# Run npm ci and get Playwright version
- name: 🏗 Prepare Playwright env
shell: bash
run: |
PLAYWRIGHT_VERSION=$(npm ls --json @playwright/test | jq --raw-output '.dependencies["@playwright/test"].version')
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
# Cache browser binaries, cache key is based on Playwright version and OS
- name: 🧰 Cache Playwright browser binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: "~/.cache/ms-playwright"
key: "${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}"
restore-keys: |
${{ runner.os }}-playwright-
# Install browser binaries & OS dependencies if cache missed
- name: 🏗 Install Playwright browser binaries & OS dependencies
if: steps.playwright-cache.outputs.cache-hit != 'true'
shell: bash
run: pnpm --filter playwright exec playwright install chromium --with-deps

# Install only the OS dependencies if cache hit
- name: 🏗 Install Playwright OS dependencies
if: steps.playwright-cache.outputs.cache-hit == 'true'
shell: bash
run: pnpm --filter playwright exec playwright install-deps
13 changes: 13 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Trigger https://argos-ci.com/docs build

on:
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Call Vercel Build Hook
run: curl -X POST https://api.vercel.com/v1/integrations/deploy/prj_CA7x4b2WrAC80ELqOxJJYcvCX8kn/SpLzd2cg6b
160 changes: 158 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ jobs:
name: core-dist
path: packages/core/dist

- name: Upload "@argos-ci/playwright" dist
uses: actions/upload-artifact@v3
with:
name: playwright-dist
path: packages/playwright/dist

unit:
needs: ["build"]

Expand Down Expand Up @@ -80,10 +86,16 @@ jobs:
name: core-dist
path: packages/core/dist

- name: Download "@argos-ci/playwright" dist
uses: actions/download-artifact@v3
with:
name: playwright-dist
path: packages/playwright/dist

- name: Test
run: npm run test

e2e:
e2e-core:
needs: ["build"]

strategy:
Expand Down Expand Up @@ -116,7 +128,151 @@ jobs:
path: packages/core/dist

- name: Run integration tests
run: npm run e2e
run: pnpm --filter core --filter cli run e2e
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
NODE_VERSION: ${{ matrix.node-version }}
OS: ${{ matrix.os }}

e2e-cypress:
needs: ["build"]

strategy:
fail-fast: false
matrix:
node-version: [current]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup deps
uses: ./.github/actions/setup-deps
with:
node-version: ${{ matrix.node-version }}

- name: Setup Playwright
uses: ./.github/actions/setup-playwright

- name: Install Cypress
run: pnpm --filter cypress exec cypress install

- name: Download "@argos-ci/cli" dist
uses: actions/download-artifact@v3
with:
name: cli-dist
path: packages/cli/dist

- name: Download "@argos-ci/core" dist
uses: actions/download-artifact@v3
with:
name: core-dist
path: packages/core/dist

- name: Run integration tests
run: pnpm --filter cypress run e2e
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
NODE_VERSION: ${{ matrix.node-version }}
OS: ${{ matrix.os }}

e2e-playwright:
needs: ["build"]

strategy:
fail-fast: false
matrix:
node-version: [current]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup deps
uses: ./.github/actions/setup-deps
with:
node-version: ${{ matrix.node-version }}

- name: Setup Playwright
uses: ./.github/actions/setup-playwright

- name: Setup Playwright
uses: ./.github/actions/setup-playwright

- name: Download "@argos-ci/cli" dist
uses: actions/download-artifact@v3
with:
name: cli-dist
path: packages/cli/dist

- name: Download "@argos-ci/core" dist
uses: actions/download-artifact@v3
with:
name: core-dist
path: packages/core/dist

- name: Download "@argos-ci/playwright" dist
uses: actions/download-artifact@v3
with:
name: playwright-dist
path: packages/playwright/dist

- name: Run integration tests
run: pnpm --filter playwright run e2e
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
NODE_VERSION: ${{ matrix.node-version }}
OS: ${{ matrix.os }}

e2e-puppeteer:
needs: ["build"]

strategy:
fail-fast: false
matrix:
node-version: [current]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup deps
uses: ./.github/actions/setup-deps
with:
node-version: ${{ matrix.node-version }}

- name: Setup Puppeteer
run: node packages/puppeteer/node_modules/puppeteer/install.mjs

- name: Download "@argos-ci/cli" dist
uses: actions/download-artifact@v3
with:
name: cli-dist
path: packages/cli/dist

- name: Download "@argos-ci/core" dist
uses: actions/download-artifact@v3
with:
name: core-dist
path: packages/core/dist

- name: Download "@argos-ci/playwright" dist
uses: actions/download-artifact@v3
with:
name: playwright-dist
path: packages/playwright/dist

- name: Run integration tests
run: pnpm --filter puppeteer run e2e
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
NODE_VERSION: ${{ matrix.node-version }}
Expand Down
Loading

0 comments on commit f2f4d2a

Please sign in to comment.