Skip to content

F/tests

F/tests #18

Workflow file for this run

name: 'Unit Tests'
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.0]
db: [sqlite]
# php: [7.0, 5.6]
# db: [sqlite, mysql, postgres]
env:
PLUGIN: Wiki
KANBOARD_REPO: https://github.com/kanboard/kanboard.git
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: install phpenv
run: |
curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer | PHPENV_ROOT=$HOME/.phpenv-root bash
mkdir -p $HOME/.local/bin && ln -s $HOME/.phpenv-root/bin/phpenv $HOME/.local/bin/phpenv
eval "$(phpenv init -)"
exec $SHELL -l
# echo 'export PATH="${PHPENV_ROOT}/bin:${PATH}"' >> ~/.bash_profile
# FILE="$PHPENV_ROOT/bin/phpenv"
# if [ -f "$FILE" ]; then
# echo "$FILE exists."
# fi
# export PATH="${PHPENV_ROOT}/bin:${PATH}"
# source ~/.bash_profile
# - name: ls $PHPENV_ROOT
# run: ls $PHPENV_ROOT
# - name: ls $PHPENV_ROOT/bin
# run: ls $PHPENV_ROOT/bin
- name: Clone Kanboard repository
run: git clone --depth 1 $KANBOARD_REPO
- name: Create symbolic link
run: ln -s ${{ github.workspace }} kanboard/plugins/$PLUGIN
# - phpenv config-add tests/php.ini
- name: Install Composer dependencies
run: |
cd kanboard
composer install
- name: List plugin directory
run: ls -la plugins/
- name: Run PHPUnit tests
run: phpunit -c tests/units.${{ matrix.db }}.xml plugins/$PLUGIN/Test/