diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 8abf473a..7bf6fc92 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -42,8 +42,8 @@ on: matrix_linux_swift_container_image: type: string # Note: we don't use Amazon Linux 2 here because zip is not installed by default. - description: "Container image for the matrix test jobs. Defaults to Swift 6.2 on Amazon Linux 2." - default: "swift:6.2-amazonlinux2" + description: "Container image for the matrix test jobs. Defaults to Swift 6.2" + default: "swift:6.2" ## We are cancelling previously triggered workflow runs concurrency: @@ -66,35 +66,24 @@ jobs: container: image: ${{ matrix.swift.image }} steps: - # GitHub checkout action has a dep on NodeJS 20 which is not running on Amazonlinux2 - # workaround is to manually checkout the repository - # https://github.com/actions/checkout/issues/1487 - - name: Manually Clone repository and checkout PR - env: - PR_NUMBER: ${{ github.event.pull_request.number }} + - name: Checkout repository + uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Cache SPM dependencies + uses: actions/cache@v5 + with: + path: Examples/${{ matrix.examples }}/.build + key: spm-${{ runner.os }}-${{ matrix.examples }}-${{ hashFiles(format('Examples/{0}/Package.swift', matrix.examples)) }} + restore-keys: | + spm-${{ runner.os }}-${{ matrix.examples }}- + + - name: Install dependencies run: | - # Clone the repository - git clone https://github.com/${{ github.repository }} - cd ${{ github.event.repository.name }} - - # Fetch the pull request - git fetch origin +refs/pull/$PR_NUMBER/merge: - - # Checkout the pull request - git checkout -qf FETCH_HEAD - - # - name: Checkout repository - # uses: actions/checkout@v4 - # with: - # persist-credentials: false - - - name: Mark the workspace as safe - working-directory: ${{ github.event.repository.name }} # until we can use action/checkout@v4 - # https://github.com/actions/checkout/issues/766 - run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + apt-get -qq update && apt-get -qq -y install libssl-dev - name: Run matrix job - working-directory: ${{ github.event.repository.name }} # until we can use action/checkout@v4 env: COMMAND: ${{ inputs.matrix_linux_command }} EXAMPLE: ${{ matrix.examples }} @@ -116,9 +105,15 @@ jobs: with: persist-credentials: false - - name: Mark the workspace as safe - # https://github.com/actions/checkout/issues/766 - run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Cache SPM dependencies + uses: actions/cache@v5 + with: + path: | + Examples/${{ matrix.examples }}/.build/checkouts + Examples/${{ matrix.examples }}/.build/repositories + key: spm-${{ runner.os }}-${{ matrix.examples }}-${{ hashFiles(format('Examples/{0}/Package.swift', matrix.examples)) }} + restore-keys: | + spm-${{ runner.os }}-${{ matrix.examples }}- - name: Test the archive plugin env: @@ -133,34 +128,19 @@ jobs: container: image: ${{ inputs.matrix_linux_swift_container_image }} steps: - # GitHub checkout action has a dep on NodeJS 20 which is not running on Amazonlinux2 - # workaround is to manually checkout the repository - # https://github.com/actions/checkout/issues/1487 - - name: Manually Clone repository and checkout PR - env: - PR_NUMBER: ${{ github.event.pull_request.number }} - run: | - # Clone the repository - git clone https://github.com/${{ github.repository }} - cd ${{ github.event.repository.name }} + - name: Checkout repository + uses: actions/checkout@v6 + with: + persist-credentials: false - # Fetch the pull request - git fetch origin +refs/pull/$PR_NUMBER/merge: - - # Checkout the pull request - git checkout -qf FETCH_HEAD - - # - name: Checkout repository - # uses: actions/checkout@v4 - # with: - # persist-credentials: false - - - name: Mark the workspace as safe - working-directory: ${{ github.event.repository.name }} # until we can use action/checkout@v4 - # https://github.com/actions/checkout/issues/766 - run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Cache SPM dependencies + uses: actions/cache@v5 + with: + path: Examples/APIGatewayV2/.build + key: spm-foundation-${{ runner.os }}-${{ hashFiles('Examples/APIGatewayV2/Package.swift') }} + restore-keys: | + spm-foundation-${{ runner.os }}- - name: Check for Foundation or ICU dependency - working-directory: ${{ github.event.repository.name }} # until we can use action/checkout@v4 run: | .github/workflows/scripts/check-link-foundation.sh