diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 994bbe090e3..80a7ac41422 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -49,21 +49,57 @@ jobs: - name: install Chrome stable run: | npx @puppeteer/browsers install chrome@stable - - name: Test setup and yarn install + - name: Test setup run: | cp config/ci.config.json config/project.json - yarn - name: yarn build run: yarn build - name: Archive build if: ${{ !cancelled() }} run: | - tar -cf build.tar --exclude=.git . - gzip build.tar + tar -czvf dists.tar.gz $(find packages -name dist -type d) - name: Upload build archive if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: - name: build.tar.gz - path: build.tar.gz - retention-days: ${{ env.artifactRetentionDays }} \ No newline at end of file + name: dists.tar.gz + path: dists.tar.gz + retention-days: ${{ env.artifactRetentionDays }} + + test-the-rest: + name: (bulk) Node.js and Browser (Chrome) Tests + needs: build + runs-on: ubuntu-latest + steps: + # install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo + - name: install Chrome stable + run: | + npx @puppeteer/browsers install chrome@stable + - name: Download build archive + uses: actions/download-artifact@v4 + with: + name: dists.tar.gz + - name: Unzip build artifact + run: tar xf dists.tar.gz + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + - name: Restore cached node_modules + uses: actions/cache@v4 + id: node_modules + with: + path: "**/node_modules" + key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} + - run: yarn install --frozen-lockfile + - name: Test setup + run: | + cp config/ci.config.json config/project.json + - name: Set start timestamp env var + run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV + - name: Run unit tests + # Ignore auth and firestore since they're handled in their own separate jobs. + run: | + xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' test:ci + node scripts/print_test_logs.js + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }} \ No newline at end of file