|  | 
|  | 1 | +name: (DevTools) Regression Tests | 
|  | 2 | + | 
|  | 3 | +on: | 
|  | 4 | +  pull_request: | 
|  | 5 | +    branches: | 
|  | 6 | +      - 'gh/poteto/**' # @nocommit | 
|  | 7 | +  schedule: | 
|  | 8 | +    - cron: 0 0 * * * | 
|  | 9 | +  workflow_dispatch: | 
|  | 10 | +    inputs: | 
|  | 11 | +      prerelease_commit_sha: | 
|  | 12 | +        required: false | 
|  | 13 | + | 
|  | 14 | +env: | 
|  | 15 | +  TZ: /usr/share/zoneinfo/America/Los_Angeles | 
|  | 16 | + | 
|  | 17 | +jobs: | 
|  | 18 | +  download_build: | 
|  | 19 | +    if: inputs.prerelease_commit_sha == '' | 
|  | 20 | +    name: Download base build | 
|  | 21 | +    runs-on: ubuntu-latest | 
|  | 22 | +    steps: | 
|  | 23 | +      - uses: actions/checkout@v4 | 
|  | 24 | +      - uses: actions/setup-node@v4 | 
|  | 25 | +        with: | 
|  | 26 | +          node-version: 18.20.1 | 
|  | 27 | +          cache: yarn | 
|  | 28 | +          cache-dependency-path: yarn.lock | 
|  | 29 | +      - name: Restore cached node_modules | 
|  | 30 | +        uses: actions/cache@v4 | 
|  | 31 | +        id: node_modules | 
|  | 32 | +        with: | 
|  | 33 | +          path: "**/node_modules" | 
|  | 34 | +          key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }} | 
|  | 35 | +      - run: yarn install --frozen-lockfile | 
|  | 36 | +      - run: yarn install --frozen-lockfile | 
|  | 37 | +        working-directory: scripts/release | 
|  | 38 | +      - name: Download react-devtools artifacts for base revision | 
|  | 39 | +        run: | | 
|  | 40 | +          git fetch origin main | 
|  | 41 | +          GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build-ghaction.js --commit=$(git rev-parse origin/main) | 
|  | 42 | +      - name: Display structure of build | 
|  | 43 | +        run: ls -R build | 
|  | 44 | +      - name: Archive build | 
|  | 45 | +        uses: actions/upload-artifact@v4 | 
|  | 46 | +        with: | 
|  | 47 | +          name: build | 
|  | 48 | +          path: build | 
|  | 49 | + | 
|  | 50 | +  build_devtools_and_process_artifacts: | 
|  | 51 | +    name: Build DevTools and process artifacts | 
|  | 52 | +    needs: download_build | 
|  | 53 | +    runs-on: ubuntu-latest | 
|  | 54 | +    steps: | 
|  | 55 | +      - uses: actions/checkout@v4 | 
|  | 56 | +      - uses: actions/setup-node@v4 | 
|  | 57 | +        with: | 
|  | 58 | +          node-version: 18.20.1 | 
|  | 59 | +          cache: yarn | 
|  | 60 | +          cache-dependency-path: yarn.lock | 
|  | 61 | +      - name: Restore cached node_modules | 
|  | 62 | +        uses: actions/cache@v4 | 
|  | 63 | +        id: node_modules | 
|  | 64 | +        with: | 
|  | 65 | +          path: "**/node_modules" | 
|  | 66 | +          key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} | 
|  | 67 | +      - run: yarn install --frozen-lockfile | 
|  | 68 | +      - name: Restore archived build | 
|  | 69 | +        uses: actions/download-artifact@v4 | 
|  | 70 | +        with: | 
|  | 71 | +          name: build | 
|  | 72 | +          path: build | 
|  | 73 | +      - run: ./scripts/circleci/pack_and_store_devtools_artifacts.sh | 
|  | 74 | +        env: | 
|  | 75 | +          RELEASE_CHANNEL: experimental | 
|  | 76 | +      - name: Display structure of build | 
|  | 77 | +        run: ls -R build | 
|  | 78 | +      - name: Archive devtools build | 
|  | 79 | +        uses: actions/upload-artifact@v4 | 
|  | 80 | +        with: | 
|  | 81 | +          name: react-devtools | 
|  | 82 | +          path: build/devtools.tgz | 
|  | 83 | +      # Simplifies getting the extension for local testing | 
|  | 84 | +      - name: Archive chrome extension | 
|  | 85 | +        uses: actions/upload-artifact@v4 | 
|  | 86 | +        with: | 
|  | 87 | +          name: react-devtools-chrome-extension | 
|  | 88 | +          path: build/devtools/chrome-extension.zip | 
|  | 89 | +      - name: Archive firefox extension | 
|  | 90 | +        uses: actions/upload-artifact@v4 | 
|  | 91 | +        with: | 
|  | 92 | +          name: react-devtools-firefox-extension | 
|  | 93 | +          path: build/devtools/firefox-extension.zip | 
|  | 94 | + | 
|  | 95 | +  run_devtools_tests_for_versions: | 
|  | 96 | +    name: Run DevTools tests for versions | 
|  | 97 | +    needs: build_devtools_and_process_artifacts | 
|  | 98 | +    runs-on: ubuntu-latest | 
|  | 99 | +    strategy: | 
|  | 100 | +      matrix: | 
|  | 101 | +        version: | 
|  | 102 | +          - 16.0 | 
|  | 103 | +          - 16.5 # schedule package | 
|  | 104 | +          - 16.8 # hooks | 
|  | 105 | +          - 17.0 | 
|  | 106 | +          - 18.0 | 
|  | 107 | +    continue-on-error: true | 
|  | 108 | +    steps: | 
|  | 109 | +      - uses: actions/checkout@v4 | 
|  | 110 | +      - uses: actions/setup-node@v4 | 
|  | 111 | +        with: | 
|  | 112 | +          node-version: 18.20.1 | 
|  | 113 | +          cache: yarn | 
|  | 114 | +          cache-dependency-path: yarn.lock | 
|  | 115 | +      - name: Restore cached node_modules | 
|  | 116 | +        uses: actions/cache@v4 | 
|  | 117 | +        id: node_modules | 
|  | 118 | +        with: | 
|  | 119 | +          path: "**/node_modules" | 
|  | 120 | +          key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} | 
|  | 121 | +      - run: yarn install --frozen-lockfile | 
|  | 122 | +      - name: Restore archived build | 
|  | 123 | +        uses: actions/download-artifact@v4 | 
|  | 124 | +        with: | 
|  | 125 | +          name: build | 
|  | 126 | +      - name: Restore archived react-devtools | 
|  | 127 | +        uses: actions/download-artifact@v4 | 
|  | 128 | +        with: | 
|  | 129 | +          name: react-devtools | 
|  | 130 | +          path: build/devtools.tgz | 
|  | 131 | +      - name: Display structure of build | 
|  | 132 | +        run: ls -R build | 
|  | 133 | +      - run: ./scripts/circleci/download_devtools_regression_build.js ${{ matrix.version }} --replaceBuild | 
|  | 134 | +      - run: node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion ${{ matrix.version }} --ci=github | 
|  | 135 | + | 
|  | 136 | +  run_devtools_e2e_tests_for_versions: | 
|  | 137 | +    name: Run DevTools e2e tests for versions | 
|  | 138 | +    needs: build_devtools_and_process_artifacts | 
|  | 139 | +    runs-on: ubuntu-latest | 
|  | 140 | +    strategy: | 
|  | 141 | +      matrix: | 
|  | 142 | +        version: | 
|  | 143 | +          - 16.0 | 
|  | 144 | +          - 16.5 # schedule package | 
|  | 145 | +          - 16.8 # hooks | 
|  | 146 | +          - 17.0 | 
|  | 147 | +          - 18.0 | 
|  | 148 | +    continue-on-error: true | 
|  | 149 | +    steps: | 
|  | 150 | +      - uses: actions/checkout@v4 | 
|  | 151 | +      - uses: actions/setup-node@v4 | 
|  | 152 | +        with: | 
|  | 153 | +          node-version: 18.20.1 | 
|  | 154 | +          cache: yarn | 
|  | 155 | +          cache-dependency-path: yarn.lock | 
|  | 156 | +      - name: Restore cached node_modules | 
|  | 157 | +        uses: actions/cache@v4 | 
|  | 158 | +        id: node_modules | 
|  | 159 | +        with: | 
|  | 160 | +          path: "**/node_modules" | 
|  | 161 | +          key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} | 
|  | 162 | +      - run: yarn install --frozen-lockfile | 
|  | 163 | +      - name: Restore archived build | 
|  | 164 | +        uses: actions/download-artifact@v4 | 
|  | 165 | +        with: | 
|  | 166 | +          name: build | 
|  | 167 | +      - name: Restore archived react-devtools | 
|  | 168 | +        uses: actions/download-artifact@v4 | 
|  | 169 | +        with: | 
|  | 170 | +          name: react-devtools | 
|  | 171 | +          path: build/devtools.tgz | 
|  | 172 | +      - name: Display structure of build | 
|  | 173 | +        run: ls -R build | 
|  | 174 | +      - name: Playwright install deps | 
|  | 175 | +        run: | | 
|  | 176 | +          npx playwright install | 
|  | 177 | +          sudo npx playwright install-deps | 
|  | 178 | +      - run: ./scripts/circleci/download_devtools_regression_build.js ${{ matrix.version }} | 
|  | 179 | +      - run: ls -R build-regression | 
|  | 180 | +      - run: ./scripts/circleci/run_devtools_e2e_tests.js ${{ matrix.version }} | 
|  | 181 | +        env: | 
|  | 182 | +          RELEASE_CHANNEL: experimental | 
|  | 183 | +      - name: Cleanup build regression folder | 
|  | 184 | +        run: rm -r ./build-regression | 
|  | 185 | +      - uses: actions/upload-artifact@v4 | 
|  | 186 | +        with: | 
|  | 187 | +          name: screenshots | 
|  | 188 | +          path: ./tmp/screenshots | 
0 commit comments