From a6d2399e2428abf2b23e6022844441204ded27d9 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 | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 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..1abfb58 --- /dev/null +++ b/.github/workflows/stepup-behat.yml @@ -0,0 +1,37 @@ +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 + cp gateway/surfnet_yubikey.yaml.dist gateway/surfnet_yubikey.yaml + docker compose -f docker-compose.yml -f docker-compose-behat.yml up -d + - name: Install composer dependencies on the Behat container + run: | + cd stepup + docker exec -t stepup-behat-1 bash -lc "composer install --ignore-platform-reqs -n" + - name: Run Behat tests + run: | + cd stepup + docker exec -t stepup-behat-1 bash -lc "./behat" + - name: Output logs on failure + if: failure() + run: docker compose logs