diff --git a/.github/workflows/ssr.yml b/.github/workflows/ssr.yml index 98ba0e02ea8408e1381eee3e2462d947739e0d98..7bdbd245031cfe8cb17077225ba43f7c71e537d0 100644 --- a/.github/workflows/ssr.yml +++ b/.github/workflows/ssr.yml @@ -7,25 +7,59 @@ on: branches: - next jobs: - cypress-run: - runs-on: ubuntu-latest + ssr: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + node_version: [12] + include: + - os: macos-latest + node_version: 12 + - os: windows-latest + node_version: 12 + fail-fast: false + name: 'ssr: node-${{ matrix.node_version }}, ${{ matrix.os }}' steps: - name: Checkout uses: actions/checkout@v2 - - name: Install - run: yarn + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node_version }} + + - name: Get yarn cache directory + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Set dependencies cache + uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }} + ${{ runner.os }}-${{ matrix.node_version }}- + + - name: Versions + run: yarn versions + + - name: Install dependencies + run: yarn install --frozen-lockfile + - name: Build all run: npm run build + - name: Install ssr working-directory: ./packages/playground/ssr - run: yarn + run: yarn install --frozen-lockfile + - name: Cypress run uses: cypress-io/github-action@v2 with: install: false - start: | - cd ./packages/playground/ssr - npm run dev:ssr + start: npm run e2e:dev:ssr project: ./packages/playground/ssr wait-on: 'http://localhost:3000' wait-on-timeout: 120 diff --git a/package.json b/package.json index bbff3918a89abc7c9ee9d4dc115d867b7911625c..d3d69545e2fa8d428a0eacdf4752c7547871e169 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "ls-lint": "ls-lint", "test": "jest", "preinstall": "node ./scripts/checkYarn.js", - "e2e:ssr": "cypress open --project packages/playground/ssr" + "e2e:ssr": "cypress open --project packages/playground/ssr", + "e2e:dev:ssr": "cd packages/playground/ssr && npm run dev:ssr" }, "types": "test-dts/index.d.ts", "tsd": {