diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 938001f..866f540 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,6 +86,10 @@ jobs: os: ubuntu-latest - suite: rspress os: ubuntu-latest + - suite: examples + os: ubuntu-latest + - suite: modernjs + os: ubuntu-latest fail-fast: false runs-on: ${{ matrix.os }} name: rstest (${{ matrix.suite }}) diff --git a/.github/workflows/rstest-ecosystem-ci-from-commit.yml b/.github/workflows/rstest-ecosystem-ci-from-commit.yml index 3379e88..1669de1 100644 --- a/.github/workflows/rstest-ecosystem-ci-from-commit.yml +++ b/.github/workflows/rstest-ecosystem-ci-from-commit.yml @@ -30,7 +30,7 @@ on: - rsbuild - rsdoctor - modernjs - # - examples + - examples suiteRefType: description: "type of suite ref to use" required: true @@ -89,8 +89,8 @@ jobs: os: ubuntu-latest - suite: rsdoctor os: ubuntu-latest - # - suite: examples - # os: ubuntu-latest + - suite: examples + os: ubuntu-latest fail-fast: false runs-on: ${{ matrix.os }} name: execute-all (${{ matrix.suite }}) diff --git a/.github/workflows/rstest-ecosystem-ci-from-pr.yml b/.github/workflows/rstest-ecosystem-ci-from-pr.yml index fb566ee..8bdf562 100644 --- a/.github/workflows/rstest-ecosystem-ci-from-pr.yml +++ b/.github/workflows/rstest-ecosystem-ci-from-pr.yml @@ -34,6 +34,7 @@ on: - rsbuild - rsdoctor - modernjs + - examples suiteRefType: description: "type of suite ref to use" required: true @@ -85,6 +86,8 @@ jobs: os: ubuntu-latest - suite: modernjs os: ubuntu-latest + - suite: examples + os: ubuntu-latest fail-fast: false runs-on: ${{ matrix.os }} name: execute-all (${{ matrix.suite }}) diff --git a/.github/workflows/rstest-ecosystem-ci-selected.yml b/.github/workflows/rstest-ecosystem-ci-selected.yml index 6393709..6279ffd 100644 --- a/.github/workflows/rstest-ecosystem-ci-selected.yml +++ b/.github/workflows/rstest-ecosystem-ci-selected.yml @@ -41,7 +41,7 @@ on: - rsbuild - rsdoctor - modernjs - # - examples + - examples suiteRefType: description: "type of suite ref to use" required: true @@ -95,8 +95,8 @@ jobs: os: ubuntu-latest - suite: modernjs os: ubuntu-latest - # - suite: examples - # os: ubuntu-latest + - suite: examples + os: ubuntu-latest fail-fast: false runs-on: ${{ matrix.os }} name: execute-all (${{ matrix.suite }}) diff --git a/tests/rstest/examples.ts b/tests/rstest/examples.ts new file mode 100644 index 0000000..8b7848c --- /dev/null +++ b/tests/rstest/examples.ts @@ -0,0 +1,14 @@ +import type { RunOptions } from '../../types'; +import { $, runInRepo } from '../../utils'; + +export async function test(options: RunOptions) { + await runInRepo({ + ...options, + repo: 'rstackjs/rstack-examples', + branch: 'main', + test: ['test:rstest'], + beforeTest: async () => { + await $`npx playwright install chromium webkit --with-deps`; + }, + }); +} diff --git a/tests/rstest/modernjs.ts b/tests/rstest/modernjs.ts index 48f00d0..21183fa 100644 --- a/tests/rstest/modernjs.ts +++ b/tests/rstest/modernjs.ts @@ -1,7 +1,7 @@ import { join } from 'node:path'; import cache from '@actions/cache'; import type { RunOptions } from '../../types'; -import { $, runInRepo } from '../../utils'; +import { $, cd, runInRepo } from '../../utils'; const isGitHubActions = !!process.env.GITHUB_ACTIONS; @@ -42,6 +42,14 @@ export async function test(options: RunOptions) { await cache.saveCache([nxCachePath], nxCacheKey); } }, - test: ['test:ut'], + test: [ + 'test:ut', + async () => { + cd('./tests'); + await $`npx playwright install chromium webkit --with-deps`; + await $`pnpm run test:rstest`; + cd('..'); + }, + ], }); }