diff --git a/.github/actions/setup-environment/action.yml b/.github/actions/setup-environment/action.yml new file mode 100644 index 000000000..4c9137871 --- /dev/null +++ b/.github/actions/setup-environment/action.yml @@ -0,0 +1,12 @@ +name: 'Setup Environment' +description: 'Sets up Boardwalk development environment' +runs: + using: composite + steps: + - name: Install Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.1.42 + + - name: Install Dependencies + run: bun install --frozen-lockfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f60b2afc8..8fc13223c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,30 +1,56 @@ -name: CI +name: CI Pipeline on: - push: - branches: [master] pull_request: - branches: [master] - -permissions: - checks: write - pull-requests: write + push: jobs: - test: - name: Run Tests + code-checks: + name: "Format, Lint, and Types Check" runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout Code uses: actions/checkout@v4 - - name: Install Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: 1.1.42 + - name: Setup Environment + uses: .github/actions/setup-environment + + - name: Run Format, Lint, and Types Check + run: bun run check-all + + unit-tests: + name: "Unit Tests" + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 - - name: Install dependencies - run: bun install --frozen-lockfile + - name: Setup Environment + uses: .github/actions/setup-environment - - name: Run tests - run: bun test \ No newline at end of file + - name: Run Unit Tests + run: bun test + + e2e-tests: + name: "E2E Tests" + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup Environment + uses: .github/actions/setup-environment + + - name: Install Playwright Browsers + run: bunx playwright install --with-deps + + - name: Run E2E Tests + run: bun run test:e2e + + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 \ No newline at end of file diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml deleted file mode 100644 index 29f1d8c0d..000000000 --- a/.github/workflows/playwright.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Playwright Tests -on: - push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] -jobs: - test: - timeout-minutes: 60 - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: 1.1.42 - - - name: Install dependencies - run: bun install --frozen-lockfile - - - name: Install Playwright Browsers - run: bunx playwright install --with-deps - - - name: Run Playwright tests - run: bun run test:e2e - - - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - name: playwright-report - path: playwright-report/ - retention-days: 30