From 74abb25c228b956fa8a410223f988c9e25cbf62e Mon Sep 17 00:00:00 2001 From: Peter Baumgartner Date: Tue, 16 Apr 2024 17:50:50 -0600 Subject: [PATCH] Test app.json too --- .github/workflows/build.yml | 58 +++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2faa98b..2eced31 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,6 +99,64 @@ 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-appjson: + 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 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 \ + ${{ 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]