From 1a2212e83a7aea769846eea63f34217245d0a648 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 4 Oct 2023 14:29:55 +0200 Subject: [PATCH] ci: aap-16400 - run e2e tests for the docker image (#583) Includes: - A new GitHub job to build the image locally and run the e2e test suite inside the image. - Reconfigure the build-push workflow to prevent executions in forks. Co-authored-by: Tom Tuffin <71447672+ttuffin@users.noreply.github.com> --- .github/workflows/build-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 225b7a4a..ab072550 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -13,7 +13,25 @@ env: QUAY_USER: ansible+eda_gha jobs: + build-and-test-image: + if: github.repository == 'ansible/ansible-rulebook' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Build local image + run: docker build -t localhost/ansible-rulebook:test . + + - name: Run tests + run: > + docker run --rm -u 0 localhost/ansible-rulebook:test bash -c ' + pip install -r requirements_test.txt && + pytest -m "e2e" -n auto' + build-and-push-image: + if: github.repository == 'ansible/ansible-rulebook' runs-on: ubuntu-latest permissions: contents: read