diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index e91bc17..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Main -on: - push: - branches: - - main -jobs: - test: - uses: ./.github/workflows/test.yml - release: - needs: - - test - uses: ./.github/workflows/release.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index dea2cb7..24f92f3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -4,4 +4,65 @@ on: types: [opened, reopened] jobs: test: - uses: ./.github/workflows/test.yml + name: test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Run tests + run: pnpm test -- --run + + e2e: + name: e2e + timeout-minutes: 10 + runs-on: ubuntu-latest + needs: + - test + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Install Playwright Browsers + run: pnpm exec playwright install --with-deps + + - name: Run Playwright tests + run: pnpm exec playwright test + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a887a2..58cfba2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,79 @@ name: Release on: - workflow_call: + push: + branches: + - main jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Run tests + run: pnpm test -- --run + + e2e: + name: e2e + timeout-minutes: 10 + runs-on: ubuntu-latest + needs: + - test + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Install Playwright Browsers + run: pnpm exec playwright install --with-deps + + - name: Run Playwright tests + run: pnpm exec playwright test + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + release: name: release runs-on: ubuntu-latest - permissions: - contents: write + needs: + - test + - e2e steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index da1f944..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Test -on: - workflow_call: - -jobs: - test: - name: test - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Install pnpm - uses: pnpm/action-setup@v3 - with: - version: 8 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - cache: "pnpm" - - - name: Install dependencies - run: pnpm install - - - name: Run tests - run: pnpm test -- --run - - e2e: - name: e2e - timeout-minutes: 10 - runs-on: ubuntu-latest - needs: - - test - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Install pnpm - uses: pnpm/action-setup@v3 - with: - version: 8 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" - - - name: Install dependencies - run: pnpm install - - - name: Install Playwright Browsers - run: pnpm exec playwright install --with-deps - - - name: Run Playwright tests - run: pnpm exec playwright test - - - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30