|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + schedule: |
| 10 | + - cron: '0 3 * * 0' # every Sunday at 3am |
| 11 | + |
| 12 | +env: |
| 13 | + CI: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + tests: |
| 17 | + name: Tests |
| 18 | + timeout-minutes: 5 |
| 19 | + runs-on: ubuntu-latest |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + # how to say "not these" so we don't miss anything? |
| 24 | + # waiting on a an api from vitest for querying |
| 25 | + # the list of tests ahead of time before running them. |
| 26 | + # |
| 27 | + # https://github.com/vitest-dev/vitest/issues/2901 |
| 28 | + # |
| 29 | + # It would be great if vitest had a flag to give us the JSON of all the tests, |
| 30 | + # so we could be sure we don't miss anything |
| 31 | + # and then generate this list from a previous C.I. job |
| 32 | + slow-test: |
| 33 | + # flags |
| 34 | + - addon-location |
| 35 | + - test-app-location |
| 36 | + - addon-only |
| 37 | + |
| 38 | + # existing monorepo |
| 39 | + - monorepo with npm |
| 40 | + - monorepo with pnpm |
| 41 | + |
| 42 | + # build-only tests for testing if the rollup config works at all |
| 43 | + - rollup-build |
| 44 | + - declarations-configuration |
| 45 | + |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v4 |
| 48 | + - uses: pnpm/action-setup@v4 |
| 49 | + - uses: actions/setup-node@v4 |
| 50 | + with: |
| 51 | + node-version: 18 |
| 52 | + cache: pnpm |
| 53 | + - name: Install Dependencies |
| 54 | + run: pnpm install --frozen-lockfile |
| 55 | + - run: pnpm vitest --testNamePattern "${{ matrix.slow-test }}" |
| 56 | + working-directory: tests |
| 57 | + |
| 58 | + |
| 59 | + defaults_tests: |
| 60 | + name: "Slow tests: ${{ matrix.slow-test }}" |
| 61 | + timeout-minutes: 5 |
| 62 | + runs-on: ubuntu-latest |
| 63 | + strategy: |
| 64 | + fail-fast: false |
| 65 | + matrix: |
| 66 | + slow-test: |
| 67 | + - defaults with npm |
| 68 | + - defaults with pnpm |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + - uses: pnpm/action-setup@v4 |
| 72 | + - uses: actions/setup-node@v4 |
| 73 | + with: |
| 74 | + node-version: 18 |
| 75 | + cache: pnpm |
| 76 | + - name: Install Dependencies |
| 77 | + run: pnpm install --frozen-lockfile |
| 78 | + - run: pnpm vitest --testNamePattern "${{ matrix.slow-test }}" |
| 79 | + working-directory: tests |
| 80 | + |
| 81 | + typescript_tests: |
| 82 | + name: "Slow tests: ${{ matrix.slow-test }}" |
| 83 | + timeout-minutes: 5 |
| 84 | + runs-on: ubuntu-latest |
| 85 | + strategy: |
| 86 | + fail-fast: false |
| 87 | + matrix: |
| 88 | + slow-test: |
| 89 | + - typescript with npm |
| 90 | + - typescript with pnpm |
| 91 | + steps: |
| 92 | + - uses: actions/checkout@v4 |
| 93 | + - uses: pnpm/action-setup@v4 |
| 94 | + - uses: actions/setup-node@v4 |
| 95 | + with: |
| 96 | + node-version: 18 |
| 97 | + cache: pnpm |
| 98 | + - name: Install Dependencies |
| 99 | + run: pnpm install --frozen-lockfile |
| 100 | + - run: pnpm vitest --testNamePattern "${{ matrix.slow-test }}" |
| 101 | + working-directory: tests |
0 commit comments