@@ -93,12 +93,132 @@ jobs:
9393 - uses : actions/setup-python@v4
9494 with :
9595 python-version : " 3.11"
96+ - name : Verify apppack.toml
97+ working-directory : ./apppack-demo-python
98+ run : |
99+ set -ex
100+ cat apppack.toml
101+ test "$(python -c 'import tomllib; print(tomllib.load(open("apppack.toml", "rb"))["services"]["web"]["command"])')" = "bash -c 'gunicorn --access-logfile - --bind 0.0.0.0:\$PORT --forwarded-allow-ips '\"'\"'*'\"'\"' app:app'"
102+
103+ integration-appjson :
104+ runs-on : ubuntu-latest
105+ needs : [test, build-image]
106+ permissions :
107+ id-token : write
108+ contents : read
109+ packages : read
110+ steps :
111+ - name : Login to GitHub Container Registry
112+ uses : docker/login-action@v2
113+ with :
114+ registry : ghcr.io
115+ username : ${{ github.actor }}
116+ password : ${{ secrets.GITHUB_TOKEN }}
117+ - name : Pull image
118+ run : docker pull ${{ needs.build-image.outputs.image }}
119+ - name : configure aws credentials
120+ uses : aws-actions/configure-aws-credentials@v1-node16
121+ with :
122+ role-to-assume : arn:aws:iam::891426818781:role/github-actions-integration-tests
123+ aws-region : us-east-1
124+ - name : Checkout sample repo
125+ run : git clone --branch app.json https://github.com/apppackio/apppack-demo-python.git
126+ - name : Run integration tests
127+ working-directory : ./apppack-demo-python
128+ run : |
129+ cat <<EOF > .envfile
130+ APPNAME=gh-integration
131+ CODEBUILD_BUILD_ID=demo-python:${{ github.run_id }}
132+ CODEBUILD_SOURCE_VERSION=${{ github.sha }}
133+ DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}
134+ DOCKERHUB_ACCESS_TOKEN=${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
135+ DOCKER_REPO=891426818781.dkr.ecr.us-east-1.amazonaws.com/github-integration-test
136+ ARTIFACT_BUCKET=integration-test-buildartifacts
137+ AWS_REGION
138+ AWS_ACCESS_KEY_ID
139+ AWS_SECRET_ACCESS_KEY
140+ AWS_SESSION_TOKEN
141+ EOF
142+
143+ docker run \
144+ --rm \
145+ --privileged \
146+ --env-file .envfile \
147+ --volume /var/run/docker.sock:/var/run/docker.sock \
148+ --volume "$(pwd):/app" \
149+ --workdir /app \
150+ ${{ needs.build-image.outputs.image }} \
151+ /bin/sh -c "set -x; git config --global --add safe.directory /app && apppack-builder prebuild; apppack-builder build; apppack-builder postbuild"
152+ - uses : actions/setup-python@v4
153+ with :
154+ python-version : " 3.11"
155+ - name : Verify apppack.toml
156+ working-directory : ./apppack-demo-python
157+ run : |
158+ set -ex
159+ cat apppack.toml
160+ test "$(python -c 'import tomllib; print(tomllib.load(open("apppack.toml", "rb"))["services"]["web"]["command"])')" = "bash -c 'gunicorn --access-logfile - --bind 0.0.0.0:\$PORT --forwarded-allow-ips '\"'\"'*'\"'\"' app:app'"
161+
162+ integration-heroku20 :
163+ runs-on : ubuntu-latest
164+ needs : [test, build-image]
165+ permissions :
166+ id-token : write
167+ contents : read
168+ packages : read
169+ steps :
170+ - name : Login to GitHub Container Registry
171+ uses : docker/login-action@v2
172+ with :
173+ registry : ghcr.io
174+ username : ${{ github.actor }}
175+ password : ${{ secrets.GITHUB_TOKEN }}
176+ - name : Pull image
177+ run : docker pull ${{ needs.build-image.outputs.image }}
178+ - name : configure aws credentials
179+ uses : aws-actions/configure-aws-credentials@v1-node16
180+ with :
181+ role-to-assume : arn:aws:iam::891426818781:role/github-actions-integration-tests
182+ aws-region : us-east-1
183+ - name : Checkout sample repo
184+ run : git clone --branch buildpacks-20 https://github.com/apppackio/apppack-demo-python.git
185+ - name : Run integration tests
186+ working-directory : ./apppack-demo-python
187+ run : |
188+ cat <<EOF > .envfile
189+ APPNAME=gh-integration
190+ CODEBUILD_BUILD_ID=demo-python:${{ github.run_id }}
191+ CODEBUILD_SOURCE_VERSION=${{ github.sha }}
192+ DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}
193+ DOCKERHUB_ACCESS_TOKEN=${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
194+ DOCKER_REPO=891426818781.dkr.ecr.us-east-1.amazonaws.com/github-integration-test
195+ ARTIFACT_BUCKET=integration-test-buildartifacts
196+ ALLOW_EOL_SHIMMED_BUILDER=1
197+ AWS_REGION
198+ AWS_ACCESS_KEY_ID
199+ AWS_SECRET_ACCESS_KEY
200+ AWS_SESSION_TOKEN
201+ EOF
202+
203+ docker run \
204+ --rm \
205+ --privileged \
206+ --env-file .envfile \
207+ --volume /var/run/docker.sock:/var/run/docker.sock \
208+ --volume "$(pwd):/app" \
209+ --workdir /app \
210+ ${{ needs.build-image.outputs.image }} \
211+ /bin/sh -c "set -x; git config --global --add safe.directory /app && apppack-builder prebuild; apppack-builder build; apppack-builder postbuild"
212+ - uses : actions/setup-python@v4
213+ with :
214+ python-version : " 3.11"
96215 - name : Verify apppack.toml
97216 working-directory : ./apppack-demo-python
98217 run : |
99218 set -ex
100219 cat apppack.toml
101220 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"
221+
102222 integration-docker :
103223 runs-on : ubuntu-latest
104224 needs : [test, build-image]
@@ -161,7 +281,7 @@ jobs:
161281 runs-on : ubuntu-latest
162282 # Only run this job if the current commit is tagged with a version
163283 if : startswith(github.ref, 'refs/tags/v')
164- needs : [test, build-image, integration, integration-docker]
284+ needs : [test, build-image, integration, integration-docker, integration-appjson, integration-heroku20 ]
165285 permissions :
166286 id-token : write
167287 contents : read
0 commit comments