From afb107b583bd7daa1d0cedcb9f68955f8db526cf Mon Sep 17 00:00:00 2001 From: Vadim S Date: Tue, 1 Mar 2022 16:18:12 +0100 Subject: [PATCH 1/2] Add docker-composer adds docker compoer file that will be used for the conversion from travisci to github actions --- ci/qa/docker/docker-composer.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ci/qa/docker/docker-composer.yml diff --git a/ci/qa/docker/docker-composer.yml b/ci/qa/docker/docker-composer.yml new file mode 100644 index 00000000..d237525f --- /dev/null +++ b/ci/qa/docker/docker-composer.yml @@ -0,0 +1,11 @@ +version: '2.2' + +services: + php-test.stepup.example.com: + stdin_open: true + image: ghcr.io/openconext/openconext-containers/openconext-php-test-stepup:latest + container_name: ra-test + volumes: + - ../../:/var/www + environment: + APP_ENV: test From b35d5cf33c02dc7f101b290b25e43b84a8d01a9f Mon Sep 17 00:00:00 2001 From: Vadim S Date: Wed, 2 Mar 2022 08:44:15 +0100 Subject: [PATCH 2/2] Create the test-integration docker-compose.yml file The following test-integration workflow will start up the container using the docker-composer file. afterwards it will do some installation and then run the tests. Also fixed typo in file name of docker-compose --- .github/workflows/test-integration.yml | 53 +++++++++++-------- .../docker-compose.yml} | 0 2 files changed, 30 insertions(+), 23 deletions(-) rename ci/{qa/docker/docker-composer.yml => docker/docker-compose.yml} (100%) diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 5f4f4b47..f96aeda5 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -1,25 +1,32 @@ +name: test-integration on: - pull_request: - push: - branches: [master, develop, feature/gha-testintegration] -env: - APP_ENV: test + pull_request: + push: + branches: [master, develop] jobs: - run_test: - ##should be changed to the correct docker image - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - ## installing composer should be obselete due to running on a provisioned docker container soon. -# - name: install composer and update to latest version - # - composer self-update --1 - # - composer install --prefer-dist - - ## looking into how to change ant to composer scripts in the future. - - name: install packages - #install ant - - name: run scripts - ## ant should be changed to a composer script somehow - - ant - - composer test + 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@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Init environment + run: | + cd ci/docker + docker-compose up -d + docker-compose exec -t ra-test bash + - name: Composer install + run: composer install + - name: Run test scripts + run: composer test + - name: Output log files on failure + if: failure() + run: cd ci/docker && docker-compose exec -T ra-test cat var/log/error.log diff --git a/ci/qa/docker/docker-composer.yml b/ci/docker/docker-compose.yml similarity index 100% rename from ci/qa/docker/docker-composer.yml rename to ci/docker/docker-compose.yml