From 9e57de512a8cce6cbb225db7721981dc4f384599 Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Thu, 4 Jan 2024 23:46:09 +0530 Subject: [PATCH] feat: use actions --- .github/workflows/ci.yml | 12 ++---------- .github/workflows/e2e-tests.yml | 17 +++++++---------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index deda53ff0..53ed03f20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,20 +23,12 @@ jobs: with: fetch-depth: 2 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: npm - - - name: Install dependencies - run: npm ci + - uses: ./.github/actions/node-install - name: Copy env run: cp .env.example .env - - name: Build - run: npm run build + - uses: ./.github/actions/cache-build build_docker: name: Build Docker Image diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 7b05458d9..9d1782363 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -6,26 +6,21 @@ on: branches: ['main'] jobs: e2e_tests: - name: "E2E Tests" + name: 'E2E Tests' timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: npm - - name: Install dependencies - run: npm ci - name: Copy env run: cp .env.example .env + - uses: ./.github/actions/node-install + - name: Start Services run: npm run dx:up - - name: Install Playwright Browsers - run: npx playwright install --with-deps + - uses: ./.github/actions/playwright-install - name: Generate Prisma Client run: npm run prisma:generate -w @documenso/prisma @@ -36,6 +31,8 @@ jobs: - name: Seed the database run: npm run prisma:seed + - uses: ./.github/actions/cache-build + - name: Run Playwright tests run: npm run ci @@ -43,7 +40,7 @@ jobs: if: always() with: name: test-results - path: "packages/app-tests/**/test-results/*" + path: 'packages/app-tests/**/test-results/*' retention-days: 30 env: TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}