Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration to run tests in Github Actions #271

Merged
merged 2 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 30 additions & 23 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay with me to leave this like this for now.

11 changes: 11 additions & 0 deletions ci/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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