From af0128f8e567f91ad66d465242150e1772a9e7e6 Mon Sep 17 00:00:00 2001 From: asmyshlyaev177 Date: Sat, 29 Jun 2024 18:55:26 +0400 Subject: [PATCH] ci: update github action --- .github/workflows/playwright.yml | 27 ------------------------- .github/workflows/tests.yml | 34 ++++++++++++++++++++++++++++++++ package-lock.json | 4 ++-- 3 files changed, 36 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/playwright.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml deleted file mode 100644 index 5156520..0000000 --- a/.github/workflows/playwright.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Playwright Tests -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] -jobs: - test: - timeout-minutes: 60 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: Install dependencies - run: npm ci - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - name: Run Playwright tests - run: npx playwright test - - uses: actions/upload-artifact@v3 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d994af2 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,34 @@ +name: Playwright Tests +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + cache-dependency-path: 'package-lock.json' + - name: Install dependencies + run: npm ci + - name: Unit tests + run: npm run test:unit + - name: setup Playwright + run: | + mkdir -p /root/.cache/ms-playwright \ + chmod -R 777 /root/.cache/ms-playwright \ + npx cross-env HOME=/root npx playwright install chromium firefox webkit --with-deps + - name: Run Playwright tests + run: npx cross-env HOME=/root npm run test:int + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 10 diff --git a/package-lock.json b/package-lock.json index efe41d0..3bdbda9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "url-state", - "version": "1.0.2", + "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "url-state", - "version": "1.0.2", + "version": "0.1.0", "license": "ISC", "workspaces": [ "packages/url-state",