Skip to content

Add Appwrite Tests and Matrix the workflow #130

Add Appwrite Tests and Matrix the workflow

Add Appwrite Tests and Matrix the workflow #130

Workflow file for this run

name: Tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
IMAGE: migrations-dev
CACHE_KEY: migrations-dev-${{ github.sha }}
on:
pull_request:
push: { branches: [main] }
jobs:
setup:
name: Setup & Build Migrations Image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Migrations
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ env.IMAGE }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Cache Docker Image
uses: actions/cache@v3
with:
key: ${{ env.CACHE_KEY }}
path: /tmp/${{ env.IMAGE }}.tar
source_unit_tests:
name: Run Source Unit Tests
runs-on: ubuntu-latest
needs: setup
env:
COMPOSE_FILE: docker-compose.yml
strategy:
fail-fast: false
matrix:
adapter: [Appwrite, Supabase, NHost]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Load Cache
uses: actions/cache@v3
with:
key: ${{ env.CACHE_KEY }}
path: /tmp/${{ env.IMAGE }}.tar
fail-on-cache-miss: true
- name: Bring up services
run: docker-compose up -d
- name: Run ${{matrix.adapter}} Tests
run: |
docker compose exec tests php ./vendor/bin/phpunit /app/tests/Migration/Unit/Sources/${{matrix.adapter}}Test.php