diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index f94d058fb04..4ef75798af1 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -24,12 +24,52 @@ env: CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/ CHROMEDRIVER_CDNBINARIESURL: https://storage.googleapis.com/chrome-for-testing-public CHROME_VALIDATED_VERSION: linux-120.0.6099.71 + artifactRetentionDays: 14 # Bump Node memory limit NODE_OPTIONS: "--max_old_space_size=4096" jobs: + build: + name: Build the SDK + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + # This makes Actions fetch all Git history so build-changed script can diff properly. + fetch-depth: 0 + # 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 + run: | + npx @puppeteer/browsers install chrome@stable + - uses: actions/checkout@v3 + - name: Set up Node (20) + uses: actions/setup-node@v3 + with: + node-version: 22.10.0 + - name: Test setup and yarn install + run: | + cp config/ci.config.json config/project.json + yarn + - name: yarn build:changed auth + run: yarn build:changed auth + - name: Archive build + if: ${{ !cancelled() }} + run: | + tar -cf build.tar --exclude=.git . + gzip build.tar + - name: Upload build archive + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v3 + with: + name: build.tar.gz + path: build.tar.gz + retention-days: ${{ env.artifactRetentionDays }} + test-chrome: name: Test Auth on Chrome and Node If Changed + needs: build runs-on: ubuntu-latest steps: # install Chrome first, so the correct version of webdriver can be installed by chromedriver @@ -56,6 +96,12 @@ jobs: with: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 + - name: Download build archive + uses: actions/download-artifact@v3 + with: + name: build.tar.gz + - name: Unzip build artifact + run: tar xf build.tar.gz - name: Set up Node (20) uses: actions/setup-node@v3 with: @@ -64,12 +110,11 @@ jobs: run: | cp config/ci.config.json config/project.json yarn - - name: build - run: yarn build:changed auth - name: Run tests on changed packages run: xvfb-run yarn test:changed auth test-firefox: name: Test Auth on Firefox If Changed + needs: build # Whatever version of Firefox comes with 22.04 is causing Firefox # startup to hang when launched by karma. Need to look further into # why. @@ -96,8 +141,12 @@ jobs: run: | cp config/ci.config.json config/project.json yarn - - name: build - run: yarn build:changed auth + - name: Download build archive + uses: actions/download-artifact@v3 + with: + name: build.tar.gz + - name: Unzip build artifact + run: tar xf build.tar.gz - name: Run tests on auth changed packages run: xvfb-run yarn test:changed auth env: @@ -105,6 +154,7 @@ jobs: test-webkit: name: Test Auth on Webkit if Changed + needs: build runs-on: macos-latest steps: @@ -121,8 +171,12 @@ jobs: cp config/ci.config.json config/project.json yarn npx playwright install webkit - - name: build - run: yarn build:changed auth + - name: Download build archive + uses: actions/download-artifact@v3 + with: + name: build.tar.gz + - name: Unzip build artifact + run: tar xf build.tar.gz - name: Run tests on changed packages run: yarn test:changed auth env: diff --git a/.github/workflows/test-changed.yml b/.github/workflows/test-changed.yml index 6499a825725..d4fe66eea87 100644 --- a/.github/workflows/test-changed.yml +++ b/.github/workflows/test-changed.yml @@ -17,12 +17,52 @@ name: Test Modified Packages on: pull_request env: + artifactRetentionDays: 14 # Bump Node memory limit NODE_OPTIONS: "--max_old_space_size=4096" jobs: + build: + name: Build the SDK + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + # This makes Actions fetch all Git history so build-changed script can diff properly. + fetch-depth: 0 + # 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 + run: | + npx @puppeteer/browsers install chrome@stable + - uses: actions/checkout@v3 + - name: Set up Node (20) + uses: actions/setup-node@v3 + with: + node-version: 22.10.0 + - name: Test setup and yarn install + run: | + cp config/ci.config.json config/project.json + yarn + - name: yarn build:changed core + run: yarn build:changed core + - name: Archive build + if: ${{ !cancelled() }} + run: | + tar -cf build.tar --exclude=.git . + gzip build.tar + - name: Upload build archive + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v3 + with: + name: build.tar.gz + path: build.tar.gz + retention-days: ${{ env.artifactRetentionDays }} + test-chrome: name: Test Packages With Changed Files in Chrome and Node + needs: build runs-on: ubuntu-latest steps: @@ -43,13 +83,18 @@ jobs: run: | cp config/ci.config.json config/project.json yarn - - name: build - run: yarn build:changed core + - name: Download build archive + uses: actions/download-artifact@v3 + with: + name: build.tar.gz + - name: Unzip build artifact + run: tar xf build.tar.gz - name: Run tests on changed packages run: xvfb-run yarn test:changed core test-firefox: name: Test Packages With Changed Files in Firefox + needs: build # Whatever version of Firefox comes with 22.04 is causing Firefox # startup to hang when launched by karma. Need to look further into # why. @@ -72,8 +117,12 @@ jobs: run: | cp config/ci.config.json config/project.json yarn - - name: build - run: yarn build:changed core + - name: Download build archive + uses: actions/download-artifact@v3 + with: + name: build.tar.gz + - name: Unzip build artifact + run: tar xf build.tar.gz - name: Run tests on changed packages run: xvfb-run yarn test:changed core env: @@ -82,6 +131,7 @@ jobs: test-webkit: name: Test Packages With Changed Files in Webkit + needs: build runs-on: macos-latest steps: @@ -98,8 +148,12 @@ jobs: cp config/ci.config.json config/project.json yarn npx playwright install webkit - - name: build - run: yarn build:changed core + - name: Download build archive + uses: actions/download-artifact@v3 + with: + name: build.tar.gz + - name: Unzip build artifact + run: tar xf build.tar.gz - name: Run tests on changed packages run: yarn test:changed core env: