Disable cron #175
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
# Check documentation at https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions | |
# Use docker-based setup for running tests since the docker-setup already contains all bootstrapping scripts | |
# Inspired by api-platform's CI.yml | |
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: ~ | |
workflow_dispatch: ~ | |
concurrency: | |
group: 'ci-${{ github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
if: github.repository_owner == 'friends-of-forkcms' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# Check for syntax errors | |
- name: PHPLint | |
uses: overtrue/phplint@7.4 | |
- name: Setup Docker Buildx | |
if: github.ref == 'refs/heads/master' | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to ghcr | |
if: github.ref == 'refs/heads/master' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} # must be in GitHub Secrets! | |
- name: Build and push docker image | |
if: github.ref == 'refs/heads/master' | |
uses: docker/build-push-action@v2 | |
with: | |
build-args: THEME_NAME=CommerceDemo | |
push: true | |
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:latest | |
cache-to: type=inline | |
tags: ghcr.io/${{ github.repository }}:latest | |
- name: Pull images | |
run: docker-compose pull --ignore-pull-failures || true | |
- name: Start services | |
run: COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose up --build -d | |
- name: Wait for services | |
run: | | |
while status="$(docker inspect --format="{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}" "$(docker-compose ps -q app)")"; do | |
case $status in | |
starting) sleep 1;; | |
healthy) exit 0;; | |
unhealthy) | |
docker-compose ps | |
docker-compose logs | |
exit 1 | |
;; | |
esac | |
done | |
exit 1 | |
- name: Check HTTP reachability | |
run: curl -v -o /dev/null http://localhost | |
- name: PHPUnit | |
run: | | |
docker-compose exec -T app bin/simple-phpunit --coverage-clover=coverage.clover --filter '\\Modules\\Commerce' | |
docker cp $(docker-compose ps -q app):/var/www/html/coverage.clover ./coverage.clover | |
- name: Upload Coverage report | |
uses: codecov/codecov-action@v2 | |
with: | |
files: coverage.clover | |
verbose: true | |
- name: Doctrine Schema Validator | |
run: docker-compose exec -T app bin/console doctrine:schema:validate --skip-sync | |
# - name: Run PHPStan | |
# run: docker-compose exec -T app bin/phpstan --memory-limit=-1 --error-format=github |