Skip to content

Commit

Permalink
Merge pull request #948 from foodcoopshop/develop
Browse files Browse the repository at this point in the history
v3.6
  • Loading branch information
mrothauer committed Apr 12, 2023
2 parents a9ef625 + ea13f99 commit d3d10e3
Show file tree
Hide file tree
Showing 691 changed files with 13,306 additions and 8,520 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -16,6 +16,7 @@ module.exports = {
"Cookies": true,
"foodcoopshop": true,
"GdprConsent": true,
"math": true,
"Quagga": true,
"slidebars": true,
"Swiper": true
Expand Down
87 changes: 27 additions & 60 deletions .github/workflows/ci.yml
Expand Up @@ -7,60 +7,32 @@ on:
pull_request:
paths-ignore:
- '**.md'

jobs:
ci:
runs-on: ubuntu-22.04
continue-on-error: ${{matrix.experimental}}
strategy:
matrix:
php-version: ['8.1']
experimental: [false]
services:
mysql:
image: mysql:8.0
ports:
- 8888:3306
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: foodcoopshop_test
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
name: PHP ${{matrix.php-version}}

name: FoodCoopShop CI
steps:

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{matrix.php-version}}
env:
update: true #forces minor release update

- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: '18'

- uses: actions/checkout@v2

- name: Apply secrets
run: |
sed -i 's/HELLO_CASH_USERNAME/${{secrets.HELLO_CASH_USERNAME}}/' ./.github/workflows/custom_config.php
sed -i 's/HELLO_CASH_PASSWORD/${{secrets.HELLO_CASH_PASSWORD}}/' ./.github/workflows/custom_config.php
sed -i 's/HELLO_CASH_CASHIER_ID/${{secrets.HELLO_CASH_CASHIER_ID}}/' ./.github/workflows/custom_config.php
- name: Setup DB
- name: Checkout code
uses: actions/checkout@v3

- name: Run Docker Compose
run: CURRENT_UID=$(id -u):$(id -g) docker compose up -d

- name: Setup Dev Environment
run: |
mysql --version
mysql -h 127.0.0.1 --port 8888 -u root -ppassword foodcoopshop_test < ./config/sql/_installation/clean-db-structure.sql
mysql -h 127.0.0.1 --port 8888 -u root -ppassword foodcoopshop_test < ./tests/config/sql/test-db-data.sql
- name: Install vendors
# do not use ./devtools/init-dev-setup.sh because dev db is not needed
bash ./devtools/installation/set-permissions.sh
bash ./devtools/setup-dev/copy-config-files.sh
docker exec -w /app fcs.php composer install
docker exec -w /app/webroot fcs.php npm install
- name: Apply secrets
run: |
composer install --optimize-autoloader --no-progress
cp ./.github/workflows/*.php ./config/
npm --prefix ./webroot install ./webroot
sed -i 's/HELLO_CASH_USERNAME/${{secrets.HELLO_CASH_USERNAME}}/' ./config/custom_config.php
sed -i 's/HELLO_CASH_PASSWORD/${{secrets.HELLO_CASH_PASSWORD}}/' ./config/custom_config.php
sed -i 's/HELLO_CASH_CASHIER_ID/${{secrets.HELLO_CASH_CASHIER_ID}}/' ./config/custom_config.php
- name: Upload files to server
if: ${{github.event_name == 'push'}}
uses: up9cloud/action-rsync@master
Expand All @@ -75,17 +47,12 @@ jobs:
echo ${{secrets.DEPLOY_PATH}}/builds/${{github.ref}}
mkdir -p ${{secrets.DEPLOY_PATH}}/builds/${{github.ref}}
SSH_ARGS: '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'

- name: PHPStan
if: always()
run: vendor/bin/phpstan analyze -c phpstan.neon --no-interaction --no-progress

run: docker exec -w /app fcs.php php ./vendor/bin/phpstan analyze -c phpstan.neon --no-interaction --no-progress

- name: ESLint
if: always()
run: |
npm install -g eslint
bash devtools/eslint.sh
- name: PHPUnit
if: always()
run: vendor/bin/phpunit
run: docker exec -w /app fcs.php bash ./devtools/eslint.sh

- name: PHPUnit Tests
run: docker exec -w /app fcs.php php ./vendor/bin/phpunit
27 changes: 0 additions & 27 deletions .github/workflows/credentials.php

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -34,6 +34,8 @@ Thumbs.db
nbproject/*
# Visual Studio Code
.vscode
.history/
*.code-search
# Sass preprocessor
.sass-cache/

Expand Down
26 changes: 26 additions & 0 deletions .gitpod.yml
@@ -0,0 +1,26 @@
tasks:
- name: Bash
- name: Docker
init: |
docker compose pull
CURRENT_UID=$(id -u):$(id -g) docker compose up
ports:
- port: 8001
onOpen: notify
- port: 8080
onOpen: ignore
- port: 8081
onOpen: ignore
- port: 3320
onOpen: ignore
- port: 3321
onOpen: ignore

github:
prebuilds:
master: false
branches: false
pullRequests: false
pullRequestsFromForks: false
addCheck: false

0 comments on commit d3d10e3

Please sign in to comment.