diff --git a/.github/workflows/test_web.yml b/.github/workflows/test_web.yml index cdcdf270053ea..e13b9bf937ff9 100644 --- a/.github/workflows/test_web.yml +++ b/.github/workflows/test_web.yml @@ -92,11 +92,46 @@ jobs: working-directory: web run: npm test + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: web-build-${{ runner.os }}-node${{ matrix.node_version }} + path: web/packages/selfhosted/dist # TODO: maybe core too? + + browser-tests: + needs: build + if: needs.changes.outputs.should_run == 'true' + name: Test ${{ matrix.browser }} / Node.js ${{ matrix.node_version }} / ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + node_version: ["20", "22"] + os: [ubuntu-22.04, windows-latest] # TODO: Don't run browser tests on Windows because it's flaky for unknown reasons. :-( + browser: ["chrome", "firefox", "edge"] + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js ${{ matrix.node_version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node_version }} + cache: npm + cache-dependency-path: web/package-lock.json + + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: web-build-${{ runner.os }}-node${{ matrix.node_version }} + - name: Run browser-based tests - # Don't run browser tests on Windows because it's flaky for unknown reasons. :-( - if: runner.os == 'Linux' working-directory: web - run: npm run wdio -- --headless --chrome --firefox --edge + shell: bash -l {0} + run: | + npm ci + npm run build + npm run wdio -- --headless --${{ matrix.browser }} check-required: needs: changes