user-expiry.php fix idempotency issues (#739) #2944
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: docker-compose-phpunit | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| docker-compose-phpunit: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Convert variables to lowercase | |
| run: | | |
| echo "REPO_OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build docker-compose images with cache | |
| run: | | |
| docker buildx build \ | |
| --tag ghcr.io/${{ env.REPO_OWNER }}/unity-dev-identity:latest \ | |
| --cache-from type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/unity-dev-identity:buildcache \ | |
| --cache-to type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/unity-dev-identity:buildcache,mode=max \ | |
| --push \ | |
| ./tools/docker-dev/identity | |
| docker buildx build \ | |
| --tag ghcr.io/${{ env.REPO_OWNER }}/unity-dev-sql:latest \ | |
| --cache-from type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/unity-dev-sql:buildcache \ | |
| --cache-to type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/unity-dev-sql:buildcache,mode=max \ | |
| --push \ | |
| ./tools/docker-dev/sql | |
| docker buildx build \ | |
| --tag ghcr.io/${{ env.REPO_OWNER }}/unity-dev-web:latest \ | |
| --cache-from type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/unity-dev-web:buildcache \ | |
| --cache-to type=registry,ref=ghcr.io/${{ env.REPO_OWNER }}/unity-dev-web:buildcache,mode=max \ | |
| --push \ | |
| ./tools/docker-dev/web | |
| - name: Pull cache images to local Docker | |
| run: | | |
| docker pull ghcr.io/${{ env.REPO_OWNER }}/unity-dev-identity:latest | |
| docker tag ghcr.io/${{ env.REPO_OWNER }}/unity-dev-identity:latest docker-dev-identity | |
| docker pull ghcr.io/${{ env.REPO_OWNER }}/unity-dev-sql:latest | |
| docker tag ghcr.io/${{ env.REPO_OWNER }}/unity-dev-sql:latest docker-dev-sql | |
| docker pull ghcr.io/${{ env.REPO_OWNER }}/unity-dev-web:latest | |
| docker tag ghcr.io/${{ env.REPO_OWNER }}/unity-dev-web:latest docker-dev-web | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.3" | |
| tools: composer | |
| - run: composer install --dev | |
| - run: docker compose -f ./tools/docker-dev/docker-compose.yml up -d --no-build | |
| - run: docker compose -f ./tools/docker-dev/docker-compose.yml exec -w '/var/www/unity-web-portal' web bash -c 'XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover="$(mktemp --suffix=.xml)" -d --min-coverage=./coverage.php' |