From 5e3916b4b12815ef7b5b695212a1316937ea1296 Mon Sep 17 00:00:00 2001 From: jonambas Date: Fri, 19 Apr 2024 19:16:07 -0400 Subject: [PATCH] ci: add GH workflows --- .github/workflows/e2e.yml | 42 ++++++++++++++++++++++++++++++++++++++ .github/workflows/unit.yml | 30 +++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/e2e.yml create mode 100644 .github/workflows/unit.yml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000..a9c69d7 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,42 @@ +name: E2E + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + timeout-minutes: 30 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: npm ci + + - name: Install Playwright Browsers + run: npx playwright install --with-deps + + - name: Build plugin + run: npm run build + + - name: Prepare Vite app + run: npm run vite:prepare + + - name: Run Playwright tests + run: npx playwright test + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 14 diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml new file mode 100644 index 0000000..d28b0c7 --- /dev/null +++ b/.github/workflows/unit.yml @@ -0,0 +1,30 @@ +name: Unit + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: npm ci + + - name: Typecheck + run: npm run typecheck + + - name: Test + run: npm run test:ci