diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 119e19e5c5..0da1ffea8f 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -5,8 +5,6 @@ on: branches: ['**'] env: - # make chromedriver detect installed Chrome version and download the corresponding driver - DETECT_CHROMEDRIVER_VERSION: true artifactRetentionDays: 14 jobs: @@ -14,40 +12,63 @@ jobs: name: Build the SDK runs-on: ubuntu-latest steps: - # Install Chrome so the correct version of webdriver can be installed by chromedriver when - # setting up the repo. This must be done to build and execute Auth properly. - - name: install Chrome stable - # Install Chrome version 110.0.5481.177-1 as some Auth tests start to fail on version 111. - # Temporary: Auth team will explore what's going wrong with the auth tests. + - run: sudo apt update + - run: sudo apt install wget + - name: google-chrome install + if: false + id: chrome_install run: | - sudo apt-get update - sudo apt-get install wget - sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_110.0.5481.177-1_amd64.deb - sudo apt-get install -f ./google-chrome-stable_110.0.5481.177-1_amd64.deb --allow-downgrades + set -xv # echo command as they are executed + download_dir="$(mktemp -d --tmpdir=${{ runner.temp }})" + + wget \ + --no-verbose \ + https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ + --output-document \ + "$download_dir/google-chrome-stable_current_amd64.deb" + + sudo dpkg -i "$download_dir/google-chrome-stable_current_amd64.deb" + sudo apt-get install -f + + echo "Installed $(google-chrome --version)" >> "$GITHUB_STEP_SUMMARY" + chrome_version=$(google-chrome --version | awk '{ print $3 }') + echo "chrome_version=$chrome_version" >> "$GITHUB_OUTPUT" + - name: chromedriver install + run: | + set -xv # echo command as they are executed + chrome_version=$(google-chrome --version | awk '{ print $3 }') + download_dir="$(mktemp -d --tmpdir=${{ runner.temp }})" + + wget \ + --no-verbose \ + "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$chrome_version/linux64/chromedriver-linux64.zip" \ + --output-document \ + "$download_dir/chromedriver-linux64.zip" + + mkdir "$download_dir/unzipped" + unzip "$download_dir/chromedriver-linux64.zip" -d "$download_dir/unzipped" + chromedriver_exe="$download_dir/unzipped/chromedriver-linux64/chromedriver" + ls -l "$chromedriver_exe" + + # Tell the `chromedriver` npm package which binary to use. + # See https://www.npmjs.com/package/chromedriver + echo "CHROMEDRIVER_FILEPATH=$chromedriver_exe" >> "$GITHUB_ENV" + - uses: actions/checkout@v3 - - name: Set up Node (16) - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3 with: node-version: 16.x - name: Bump Node memory limit run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV - - name: Test setup and yarn install - 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 . - gzip build.tar - - name: Upload build archive - if: ${{ !cancelled() }} + - run: yarn + - run: yarn build + - if: ${{ !cancelled() }} + run: tar zcf ${{ runner.temp }}/build.tar.gz --exclude=.git --exclude=node_modules . + - if: ${{ !cancelled() }} uses: actions/upload-artifact@v3 with: name: build.tar.gz - path: build.tar.gz + path: ${{ runner.temp }}/build.tar.gz retention-days: ${{ env.artifactRetentionDays }} # Auth and Firestore are built and executed in their own jobs in an attempt to reduce flakiness.