added icon to events to better distinguish them from meals #2324
Workflow file for this run
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-ignore: | |
- 'dependabot/**' | |
tags: | |
- 'v*' | |
pull_request: | |
branches-ignore: | |
- 'dependabot/**' | |
workflow_dispatch: | |
concurrency: | |
group: ci-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
test-cgl: | |
name: Coding Guidelines Check | |
runs-on: ubuntu-latest | |
continue-on-error: false | |
env: | |
PHP_CS_FIXER_FUTURE_MODE: 1 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP environment | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
tools: composer:v2 | |
- name: Check code formatting with PHP-CS-Fixer | |
run: | | |
rm composer.json composer.lock | |
composer require friendsofphp/php-cs-fixer:3.4 | |
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist --diff --dry-run -v | |
lint: | |
name: FE Asset Linting | |
runs-on: ubuntu-latest | |
continue-on-error: false | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install npm packages | |
working-directory: ./src/Resources | |
run: yarn install | |
- name: Run FE linters | |
working-directory: ./src/Resources | |
run: yarn lint | |
phpmd: | |
name: PHPMD | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP environment | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
tools: phpmd | |
- name: Run PHPMD | |
run: phpmd src github ./phpmd.xml --baseline-file ./phpmd.baseline.xml --exclude */Tests/* | |
psalm: | |
name: Static Code Analysis | |
runs-on: ubuntu-latest | |
continue-on-error: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP environment | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
tools: composer | |
- name: Run composer install | |
run: composer install -n --prefer-dist | |
- name: Run Psalm | |
run: ./vendor/bin/psalm | |
testFrontendUnitFunctional: | |
name: Run frontend unit- and functional-tests | |
runs-on: ubuntu-latest | |
continue-on-error: false | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install npm packages | |
working-directory: ./src/Resources | |
run: yarn install | |
- name: Run FE jest suite | |
working-directory: ./src/Resources | |
run: yarn test | |
buildImages: | |
name: Build Docker Images | |
runs-on: ubuntu-latest | |
needs: [test-cgl, psalm] | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 10 | |
- name: Prepare build | |
run: | | |
mkdir -p /tmp/docker/buildx | |
git log -n 10 --date=short --format=format:"%C(auto)%h %ad @%al %s" >> public/changelog.txt | |
- name: Setup docker build caches | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-buildx | |
path: /tmp/docker/buildx | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
# Development image | |
- name: Get Docker meta for development | |
id: devmeta | |
uses: docker/metadata-action@v4 | |
with: | |
images: aoepeople/meals:beta | |
tags: | | |
type=sha | |
type=ref,event=branch | |
- name: Build and push development image | |
id: build_dev | |
uses: docker/build-push-action@v4 | |
with: | |
file: Dockerfile | |
push: false | |
tags: aoepeople/meals:test | |
labels: ${{ steps.devmeta.outputs.labels }} | |
build-args: | | |
BUILD_DEV="true" | |
cache-from: | | |
aoepeople/meals:beta | |
type=local,src=/tmp/docker/buildx | |
cache-to: type=local,dest=/tmp/docker/buildx | |
outputs: type=docker,dest=/tmp/docker/dev.tar | |
# Upload artifacts | |
- name: Upload docker images | |
uses: actions/upload-artifact@v3 | |
with: | |
name: docker-images | |
path: /tmp/docker/*.tar | |
outputs: | |
imageDev: ${{ fromJSON(steps.devmeta.outputs.json).tags[0] }} | |
imagesDev: ${{ join(steps.devmeta.outputs.tags, ' ') }} | |
cypress: | |
name: Run E2E-tests via Cypress | |
needs: [ buildImages ] | |
runs-on: ubuntu-latest | |
env: | |
SERVICE: dev # use `dev` to enable xdebug and code coverage | |
IMAGE_DEV: ${{ needs.buildImages.outputs.imageDev }} | |
COMPOSE_INTERACTIVE_NO_CLI: true | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download docker images | |
uses: actions/download-artifact@v3 | |
with: | |
name: docker-images | |
path: /tmp/docker | |
- name: Import docker image | |
run: | | |
docker load --input /tmp/docker/dev.tar | |
docker image ls -a | grep aoepeople | |
- uses: actions/setup-node@v3 | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install npm packages | |
working-directory: ./src/Resources | |
run: yarn install | |
- name: Make build dir | |
run: | | |
mkdir build | |
- name: Make .env file | |
run: | | |
sh -c "cat > .env.docker << 'EOL' | |
IDP_SERVER=\"${{ secrets.IDP_SERVER }}\" | |
IDP_CLIENT_ID=\"${{ secrets.IDP_CLIENT_ID }}\" | |
IDP_CLIENT_SECRET=\"${{ secrets.IDP_CLIENT_SECRET }}\" | |
EOL" | |
- name: Run Docker compose | |
run: | | |
docker compose -f ./docker-compose-cypress.yaml up --abort-on-container-exit & | |
echo "starting the docker compose..." & | |
yarn --cwd=./tests/e2e install && | |
until $(curl --output /dev/null --silent --head --fail http://localhost:80/); do | |
printf '.' | |
sleep 5 | |
done && | |
yarn --cwd=./tests/e2e cross-env-shell cypress run --headless --browser electron --env "baseUrl=http://localhost/,cookie_domain=localhost,ddev_test=false,mailhog_url=http://localhost:8025" | |
- name: Docker compose down | |
run: | | |
docker compose -f docker-compose-cypress.yaml down --remove-orphans | |
testBackendUnitFunctional: | |
name: Run backend unit- and functional-tests | |
needs: [ buildImages ] | |
runs-on: ubuntu-latest | |
env: | |
SERVICE: app # use `dev` to enable xdebug and code coverage | |
IMAGE_DEV: ${{ needs.buildImages.outputs.imageDev }} | |
COMPOSE_INTERACTIVE_NO_CLI: true | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- uses: actions/checkout@v3 | |
- name: Download docker images | |
uses: actions/download-artifact@v3 | |
with: | |
name: docker-images | |
path: /tmp/docker | |
- name: Import docker image | |
run: | | |
docker load --input /tmp/docker/dev.tar | |
docker image ls -a | grep aoepeople | |
- name: Test with docker compose | |
run: | | |
mkdir build | |
docker-compose -f docker-compose-test.yaml up --abort-on-container-exit | |
docker-compose -f docker-compose-test.yaml down --remove-orphans | |
- name: Upload coverage report artifact | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: reports | |
path: build/artifacts/qa/ | |
- name: Publish unit-test results | |
uses: mikepenz/action-junit-report@v3 | |
if: always() | |
with: | |
report_paths: 'build/artifacts/qa/*.xml' |