Merge pull request #4479 from alchemy-fr/PHRAS-4010-add-mysql8-datastore #803
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: CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: | |
- master | |
env: | |
PHRASEANET_DOCKER_TAG: ${{ github.head_ref }} | |
REGISTRY: ghcr.io/${{ github.repository_owner }} | |
CACHE_REGISTRY: ghcr.io/${{ github.repository_owner }} | |
jobs: | |
build-phraseanet-setup: | |
name: 'build phraseanet-setup' | |
uses: ./.github/workflows/build.yml | |
with: | |
image: phraseanet-setup | |
context: . | |
file: ./Dockerfile | |
target: phraseanet-setup | |
secrets: inherit | |
build-phraseanet-nginx: | |
name: 'build phraseanet-nginx' | |
uses: ./.github/workflows/build.yml | |
with: | |
image: phraseanet-nginx | |
context: . | |
file: ./Dockerfile | |
target: phraseanet-nginx | |
secrets: inherit | |
build-phraseanet-fpm: | |
name: 'build phraseanet-fpm' | |
uses: ./.github/workflows/build.yml | |
with: | |
image: phraseanet-fpm | |
context: . | |
file: ./Dockerfile | |
target: phraseanet-fpm | |
secrets: inherit | |
build-phraseanet-worker: | |
name: 'build phraseanet-worker' | |
uses: ./.github/workflows/build.yml | |
with: | |
image: phraseanet-worker | |
context: . | |
file: ./Dockerfile | |
target: phraseanet-worker | |
secrets: inherit | |
build-phraseanet-db: | |
name: 'build phraseanet-db' | |
uses: ./.github/workflows/build.yml | |
with: | |
image: phraseanet-db | |
context: ./docker/db | |
file: ./docker/db/Dockerfile | |
target: '' | |
secrets: inherit | |
build-phraseanet-elasticsearch: | |
name: 'build phraseanet-elasticsearch' | |
uses: ./.github/workflows/build.yml | |
with: | |
image: phraseanet-elasticsearch | |
context: ./docker/elasticsearch | |
file: ./docker/elasticsearch/Dockerfile | |
target: '' | |
secrets: inherit | |
test: | |
name: 'unit test' | |
runs-on: ubuntu-latest | |
needs: | |
- build-phraseanet-setup | |
- build-phraseanet-nginx | |
- build-phraseanet-fpm | |
- build-phraseanet-worker | |
- build-phraseanet-db | |
- build-phraseanet-elasticsearch | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get tag name | |
if: github.event_name != 'pull_request' | |
shell: bash | |
run: echo "PHRASEANET_DOCKER_TAG=${{ github.ref_name }}" >> $GITHUB_ENV | |
- name: install | |
run: | | |
PHRASEANET_DOCKER_REGISTRY=${{ env.REGISTRY }} PHRASEANET_DOCKER_TAG=${{ env.PHRASEANET_DOCKER_TAG }} docker compose pull | |
PHRASEANET_DOCKER_REGISTRY=${{ env.REGISTRY }} PHRASEANET_DOCKER_TAG=${{ env.PHRASEANET_DOCKER_TAG }} docker compose up -d | |
- name: init tools test | |
run: | | |
docker compose exec -T -e PHRASEANET_BASE_URL=http://127.0.0.1 phraseanet docker/phraseanet/setup/init-test-install.sh | |
- name: test exclude-group legacy | |
run: | | |
docker compose exec -T phraseanet bin/console system:clear-cache | |
docker compose exec -T phraseanet php -d memory_limit=-1 vendor/phpunit/phpunit/phpunit --exclude-group legacy | |
- name: test group legacy and exclude-group web | |
run: | | |
docker compose exec -T phraseanet bin/console system:clear-cache | |
docker compose exec -T phraseanet php -d memory_limit=-1 vendor/phpunit/phpunit/phpunit --group legacy --exclude-group web | |
- name: test group web | |
run: | | |
docker compose exec -T phraseanet bin/console system:clear-cache | |
docker compose exec -T phraseanet php -d memory_limit=-1 vendor/phpunit/phpunit/phpunit --group web |