Merge pull request #70 from kmtbase/feature_oxid_700 #84
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: oxrun ci | |
on: ["push"] # "pull_request" | |
jobs: | |
stand_alone_checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Validate composer.json | |
run: composer validate | |
- name: validate php syntax | |
run: find . -not -path "./vendor/*" -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | |
tests: | |
needs: stand_alone_checks | |
strategy: | |
matrix: | |
oxid: | |
- metapackage: "7.0" | |
php: "8.0" | |
runs-on: ubuntu-latest | |
container: | |
image: oxidesales/oxideshop-docker-php:${{matrix.oxid.php}} | |
env: | |
COMPILATION_VERSION: dev-b-${{matrix.oxid.metapackage}}-ce | |
DOCKER_DOCUMENT_ROOT: /var/www/oxid-esale | |
MYSQL_HOST: oxid_db | |
MYSQL_DATABASE: 'oxid' | |
MYSQL_PORT: '3306' | |
MYSQL_USER: "oxid" | |
MYSQL_PASSWORD: "oxid" | |
OXID_SHOP_URL: "http://localhost" | |
services: | |
oxid_db: | |
image: mysql:8.0 | |
env: | |
MYSQL_DATABASE: oxid | |
MYSQL_USER: oxid | |
MYSQL_PASSWORD: oxid | |
MYSQL_ROOT_PASSWORD: oxid | |
TZ: Europe/Berlin | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Setup Oxid eSale | |
run: bash ./docker/bin/installOxid.sh | |
- name: PHPUnit | |
run: ./vendor/bin/phpunit --debug --stop-on-error --stop-on-failure | |
- name: run oe-console | |
run: ${DOCKER_DOCUMENT_ROOT}/vendor/bin/oe-console | |
- name: run oxrun-light | |
run: ${DOCKER_DOCUMENT_ROOT}/vendor/bin/oxrun-light | |
- name: save coverage report | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: code-coverage-report | |
path: build/logs/clover.xml | |
retention-days: 1 | |
- name: create new readme | |
run: | | |
rm -Rf ${DOCKER_DOCUMENT_ROOT}/source/tmp/* | |
rm -Rf ${GITHUB_WORKSPACE}/vendor | |
bash ./docker/bin/updateReadmeDoc.sh "${DOCKER_DOCUMENT_ROOT}/vendor/bin/oxrun-light" | |
- name: save oxrun-description | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: oxrun-description | |
path: README.md | |
retention-days: 1 | |
finish-code-coverage: | |
if: ${{ github.ref == 'refs/heads/master' }} | |
needs: tests | |
runs-on: ubuntu-latest | |
container: | |
image: composer:latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: download coverage report | |
uses: actions/download-artifact@v2 | |
with: | |
name: code-coverage-report | |
- name: remove artifact coverage report | |
uses: geekyeggo/delete-artifact@v1 | |
with: | |
name: code-coverage-report | |
- name: Install Coveralls | |
run: composer global require php-coveralls/php-coveralls | |
- name: Coveralls Finished | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
mkdir -p ./build/logs/ | |
mv ./clover.xml ./build/logs/ | |
${COMPOSER_HOME}/vendor/bin/php-coveralls -v | |
finish-reademe: | |
if: ${{ github.ref == 'refs/heads/master' }} | |
needs: tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: download oxrun-description | |
uses: actions/download-artifact@v2 | |
with: | |
name: oxrun-description | |
- name: remove artifact oxrun-description | |
uses: geekyeggo/delete-artifact@v1 | |
with: | |
name: oxrun-description | |
- name: commit readme | |
continue-on-error: true | |
run: | | |
git config --global user.name "Github Action" | |
git config --global user.email '[email protected]' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git add ${GITHUB_WORKSPACE}/README.md | |
git commit --message "Updated commands docu in README.md. (#$GITHUB_RUN_NUMBER) [ci skip]" | |
git push -u origin HEAD:${{ github.ref }} |