From 4ee47227e7b8f2a932a1e6cfad943123958a17e9 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 30 Oct 2024 15:00:21 -0400 Subject: [PATCH 1/3] Archive builds in test-changed and test-changed-auth --- .github/workflows/test-changed-auth.yml | 58 ++++++++++++++++++++++--- .github/workflows/test-changed.yml | 58 ++++++++++++++++++++++--- 2 files changed, 104 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index f94d058fb04..fca1ad1f7a0 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -24,10 +24,44 @@ 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: + # 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 runs-on: ubuntu-latest @@ -56,6 +90,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,8 +104,6 @@ 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: @@ -96,8 +134,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: @@ -121,8 +163,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..553d1bb63ca 100644 --- a/.github/workflows/test-changed.yml +++ b/.github/workflows/test-changed.yml @@ -17,10 +17,44 @@ 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: + # 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 runs-on: ubuntu-latest @@ -43,8 +77,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 @@ -72,8 +110,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: @@ -98,8 +140,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: From 61f7b95982d3d9a33d36c9ceb4bc38ed598f6a2b Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 30 Oct 2024 15:32:47 -0400 Subject: [PATCH 2/3] Checkout repo for build --- .github/workflows/test-changed-auth.yml | 5 +++++ .github/workflows/test-changed.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index fca1ad1f7a0..b4dfbf7e987 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -33,6 +33,11 @@ jobs: 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 diff --git a/.github/workflows/test-changed.yml b/.github/workflows/test-changed.yml index 553d1bb63ca..59d631a4f8d 100644 --- a/.github/workflows/test-changed.yml +++ b/.github/workflows/test-changed.yml @@ -26,6 +26,11 @@ jobs: 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 From 308897752677445a4581eb5ee756df443856d99a Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 30 Oct 2024 15:35:47 -0400 Subject: [PATCH 3/3] Wait for build --- .github/workflows/test-changed-auth.yml | 3 +++ .github/workflows/test-changed.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index b4dfbf7e987..4ef75798af1 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -69,6 +69,7 @@ jobs: 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 @@ -113,6 +114,7 @@ jobs: 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. @@ -152,6 +154,7 @@ jobs: test-webkit: name: Test Auth on Webkit if Changed + needs: build runs-on: macos-latest steps: diff --git a/.github/workflows/test-changed.yml b/.github/workflows/test-changed.yml index 59d631a4f8d..d4fe66eea87 100644 --- a/.github/workflows/test-changed.yml +++ b/.github/workflows/test-changed.yml @@ -62,6 +62,7 @@ jobs: test-chrome: name: Test Packages With Changed Files in Chrome and Node + needs: build runs-on: ubuntu-latest steps: @@ -93,6 +94,7 @@ jobs: 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. @@ -129,6 +131,7 @@ jobs: test-webkit: name: Test Packages With Changed Files in Webkit + needs: build runs-on: macos-latest steps: