From 75d511aee1663d0bc28828874e464ae7caedf647 Mon Sep 17 00:00:00 2001 From: Peter Baumgartner Date: Tue, 16 Apr 2024 18:38:19 -0600 Subject: [PATCH] Test against legacy Heroku builder --- .github/workflows/build.yml | 63 ++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46fb848..d3658fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -157,6 +157,67 @@ jobs: set -ex cat apppack.toml test "$(python -c 'import tomllib; print(tomllib.load(open("apppack.toml", "rb"))["services"]["web"]["command"])')" = 'gunicorn --access-logfile - --bind 0.0.0.0:$PORT --forwarded-allow-ips '"'"'*'"' app:app" + + integration-heroku20: + runs-on: ubuntu-latest + needs: [test, build-image] + permissions: + id-token: write + contents: read + packages: read + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Pull image + run: docker pull ${{ needs.build-image.outputs.image }} + - name: configure aws credentials + uses: aws-actions/configure-aws-credentials@v1-node16 + with: + role-to-assume: arn:aws:iam::891426818781:role/github-actions-integration-tests + aws-region: us-east-1 + - name: Checkout sample repo + run: git clone --branch buildpacks-20 https://github.com/apppackio/apppack-demo-python.git + - name: Run integration tests + working-directory: ./apppack-demo-python + run: | + cat < .envfile + APPNAME=gh-integration + CODEBUILD_BUILD_ID=demo-python:${{ github.run_id }} + CODEBUILD_SOURCE_VERSION=${{ github.sha }} + DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_ACCESS_TOKEN=${{ secrets.DOCKERHUB_ACCESS_TOKEN }} + DOCKER_REPO=891426818781.dkr.ecr.us-east-1.amazonaws.com/github-integration-test + ARTIFACT_BUCKET=integration-test-buildartifacts + AWS_REGION + AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY + AWS_SESSION_TOKEN + EOF + + docker run \ + --rm \ + --privileged \ + --env-file .envfile \ + --volume /var/run/docker.sock:/var/run/docker.sock \ + --volume "$(pwd):/app" \ + --workdir /app \ + --env ALLOW_EOL_SHIMMED_BUILDER=1 \ + ${{ needs.build-image.outputs.image }} \ + /bin/sh -c "set -x; git config --global --add safe.directory /app && apppack-builder prebuild; apppack-builder build; apppack-builder postbuild" + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Verify apppack.toml + working-directory: ./apppack-demo-python + run: | + set -ex + cat apppack.toml + test "$(python -c 'import tomllib; print(tomllib.load(open("apppack.toml", "rb"))["services"]["web"]["command"])')" = 'gunicorn --access-logfile - --bind 0.0.0.0:$PORT --forwarded-allow-ips '"'"'*'"' app:app" + integration-docker: runs-on: ubuntu-latest needs: [test, build-image] @@ -219,7 +280,7 @@ jobs: runs-on: ubuntu-latest # Only run this job if the current commit is tagged with a version if: startswith(github.ref, 'refs/tags/v') - needs: [test, build-image, integration, integration-docker, integration-appjson] + needs: [test, build-image, integration, integration-docker, integration-appjson, integration-heroku20] permissions: id-token: write contents: read