fix: Fix test workflow and add more platforms #21
Workflow file for this run
This file contains hidden or 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" | |
| on: [pull_request] | |
| jobs: | |
| tests: | |
| name: Unit & E2E | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| platform: [amd64, arm64, arm/v7, ppc64le] | |
| env: | |
| PLATFORM: ${{ matrix.platform == 'arm/v7' && 'armv7' || matrix.platform }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 2 | |
| submodules: recursive | |
| - run: git checkout HEAD^2 | |
| - name: Install dependencies | |
| run: composer install --ignore-platform-reqs --no-interaction --prefer-dist | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build image for ${{ matrix.platform }} | |
| uses: docker/build-push-action@v3 | |
| with: | |
| context: . | |
| push: false | |
| tags: database-dev:${{ matrix.platform == 'arm/v7' && 'armv7' || matrix.platform }} | |
| load: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/${{ matrix.platform }} | |
| - name: Start Containers | |
| run: | | |
| docker compose up -d | |
| sleep 10 | |
| - name: Run Tests | |
| run: | | |
| if [[ "${{ matrix.platform }}" == "amd64" ]]; then | |
| docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml --testsuite X86; | |
| elif [[ "${{ matrix.platform }}" == "arm64" ]]; then | |
| docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml --testsuite ARM64; | |
| elif [[ "${{ matrix.platform }}" == "arm/v7" ]]; then | |
| docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml --testsuite ARMV7; | |
| elif [[ "${{ matrix.platform }}" == "ppc64le" ]]; then | |
| docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml --testsuite PPC; | |
| fi |