Add Appwrite Tests and Matrix the workflow #124
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_e2e_tests: | |
name: Run Source E2E 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/E2E/Sources/${{matrix.adapter}}Test.php |