From 101c7fb126501d8fcfc8abb8cdd5d8bcb73c2597 Mon Sep 17 00:00:00 2001 From: Michiel Kodde Date: Tue, 20 Feb 2024 11:44:06 +0100 Subject: [PATCH] Run Behat tests on Github Actions workflow --- .github/workflows/stepup-behat.yml | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/stepup-behat.yml diff --git a/.github/workflows/stepup-behat.yml b/.github/workflows/stepup-behat.yml new file mode 100644 index 0000000..f38e5a1 --- /dev/null +++ b/.github/workflows/stepup-behat.yml @@ -0,0 +1,32 @@ +name: stepup-behat +on: + pull_request: + push: + branches: [ main, feature/*, bugfix/* ] +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Init environment + run: | + cd stepup + cp .env.test .env + docker compose -f docker-compose.yml -f docker-compose-behat.yml up -d + - name: Run the behat tests + run: | + cd stepup + docker exec -ti stepup-behat-1 bash -c "./behat" + - name: Output logs on failure + if: failure() + run: docker compose logs