|
| 1 | +name: Unit Tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [ master ] |
| 6 | + |
| 7 | +jobs: |
| 8 | + Sqlite: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + container: kanboard/tests:latest |
| 11 | + steps: |
| 12 | + - name: Checkout Kanboard repo |
| 13 | + uses: actions/checkout@v2 |
| 14 | + with: |
| 15 | + repository: kanboard/kanboard |
| 16 | + - name: Checkout Plugin repo |
| 17 | + uses: actions/checkout@v2 |
| 18 | + with: |
| 19 | + path: plugins/DatabaseStorage |
| 20 | + - name: Install dependencies |
| 21 | + run: composer install --prefer-dist --no-progress --no-suggest |
| 22 | + - name: Unit tests with Sqlite |
| 23 | + run: ./vendor/bin/phpunit -c tests/units.sqlite.xml plugins/DatabaseStorage/Test/ |
| 24 | + |
| 25 | + Postgres: |
| 26 | + runs-on: ubuntu-latest |
| 27 | + container: kanboard/tests:latest |
| 28 | + services: |
| 29 | + postgres: |
| 30 | + image: postgres:9.4 |
| 31 | + env: |
| 32 | + POSTGRES_USER: postgres |
| 33 | + POSTGRES_PASSWORD: postgres |
| 34 | + POSTGRES_DB: postgres |
| 35 | + ports: |
| 36 | + - 5432:5432 |
| 37 | + options: >- |
| 38 | + --health-cmd pg_isready |
| 39 | + --health-interval 10s |
| 40 | + --health-timeout 5s |
| 41 | + --health-retries 5 |
| 42 | + steps: |
| 43 | + - name: Checkout Kanboard repo |
| 44 | + uses: actions/checkout@v2 |
| 45 | + with: |
| 46 | + repository: kanboard/kanboard |
| 47 | + - name: Checkout Plugin repo |
| 48 | + uses: actions/checkout@v2 |
| 49 | + with: |
| 50 | + path: plugins/DatabaseStorage |
| 51 | + - name: Install dependencies |
| 52 | + run: composer install --prefer-dist --no-progress --no-suggest |
| 53 | + - name: Unit tests with Postgres |
| 54 | + run: ./vendor/bin/phpunit -c tests/units.postgres.xml plugins/DatabaseStorage/Test/ |
| 55 | + env: |
| 56 | + DB_HOSTNAME: postgres |
| 57 | + DB_PORT: ${{ job.services.postgres.ports[5432] }} |
| 58 | + |
| 59 | + MariaDB: |
| 60 | + runs-on: ubuntu-latest |
| 61 | + container: kanboard/tests:latest |
| 62 | + services: |
| 63 | + mariadb: |
| 64 | + image: mariadb:latest |
| 65 | + env: |
| 66 | + MYSQL_ROOT_PASSWORD: secret |
| 67 | + ports: |
| 68 | + - 3306:3306 |
| 69 | + options: >- |
| 70 | + --health-cmd "mysqladmin ping" |
| 71 | + --health-interval 10s |
| 72 | + --health-timeout 5s |
| 73 | + --health-retries 5 |
| 74 | + steps: |
| 75 | + - name: Checkout Kanboard repo |
| 76 | + uses: actions/checkout@v2 |
| 77 | + with: |
| 78 | + repository: kanboard/kanboard |
| 79 | + - name: Checkout Plugin repo |
| 80 | + uses: actions/checkout@v2 |
| 81 | + with: |
| 82 | + path: plugins/DatabaseStorage |
| 83 | + - name: Install dependencies |
| 84 | + run: composer install --prefer-dist --no-progress --no-suggest |
| 85 | + - name: Unit tests with MariaDB |
| 86 | + run: ./vendor/bin/phpunit -c tests/units.mysql.xml plugins/DatabaseStorage/Test/ |
| 87 | + env: |
| 88 | + DB_HOSTNAME: mariadb |
| 89 | + DB_PASSWORD: secret |
| 90 | + DB_PORT: ${{ job.services.mariadb.ports[3306] }} |
0 commit comments