Skip to content

Commit 0dfbb4a

Browse files
committed
Change to Github Action
1 parent 10e5d45 commit 0dfbb4a

12 files changed

+212
-133
lines changed

.github/workflows/oxrun.yml

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: oxrun ci
2+
3+
on: ["push"] # "pull_request"
4+
5+
jobs:
6+
stand_alone_checks:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- name: Validate composer.json
11+
run: composer validate
12+
- name: validate php syntax
13+
run: find . -not -path "./vendor/*" -name "*.php" -print0 | xargs -0 -n1 -P8 php -l
14+
15+
tests:
16+
needs: stand_alone_checks
17+
strategy:
18+
matrix:
19+
oxid:
20+
- metapackage: "6.3"
21+
php: "8.0"
22+
- metapackage: "6.2"
23+
php: "7.4"
24+
25+
runs-on: ubuntu-latest
26+
container:
27+
image: oxidesales/oxideshop-docker-php:${{matrix.oxid.php}}
28+
env:
29+
COMPILATION_VERSION: dev-b-${{matrix.oxid.metapackage}}-ce
30+
DOCKER_DOCUMENT_ROOT: /var/www/oxid-esale
31+
MYSQL_HOST: oxid_db
32+
MYSQL_DATABASE: 'oxid'
33+
MYSQL_USER: "oxid"
34+
MYSQL_PASSWORD: "oxid"
35+
OXID_SHOP_URL: "http://localhost"
36+
services:
37+
oxid_db:
38+
image: mysql:5.7
39+
env:
40+
MYSQL_DATABASE: oxid
41+
MYSQL_USER: oxid
42+
MYSQL_PASSWORD: oxid
43+
MYSQL_ROOT_PASSWORD: oxid
44+
TZ: Europe/Berlin
45+
ports:
46+
- 3306:3306
47+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
48+
49+
steps:
50+
- uses: actions/checkout@v1
51+
- name: Setup Oxid eSale
52+
run: bash ./docker/bin/installOxid.sh
53+
- name: PHPUnit
54+
run: ./vendor/bin/phpunit --debug --stop-on-error --stop-on-failure
55+
- name: run oe-console
56+
run: ${DOCKER_DOCUMENT_ROOT}/vendor/bin/oe-console
57+
- name: run oxrun-light
58+
run: ${DOCKER_DOCUMENT_ROOT}/vendor/bin/oxrun-light
59+
- name: save coverage report
60+
if: ${{ github.ref == 'refs/heads/master' }}
61+
uses: actions/upload-artifact@v2
62+
with:
63+
name: code-coverage-report
64+
path: build/logs/clover.xml
65+
retention-days: 1
66+
- name: create new readme
67+
run: |
68+
rm -Rf ${DOCKER_DOCUMENT_ROOT}/source/tmp/*
69+
rm -Rf ${GITHUB_WORKSPACE}/vendor
70+
bash ./docker/bin/updateReadmeDoc.sh "${DOCKER_DOCUMENT_ROOT}/vendor/bin/oxrun-light"
71+
- name: save oxrun-description
72+
if: ${{ github.ref == 'refs/heads/master' }}
73+
uses: actions/upload-artifact@v2
74+
with:
75+
name: oxrun-description
76+
path: README.md
77+
retention-days: 1
78+
79+
finish-code-coverage:
80+
if: ${{ github.ref == 'refs/heads/master' }}
81+
needs: tests
82+
runs-on: ubuntu-latest
83+
container:
84+
image: composer:latest
85+
steps:
86+
- uses: actions/checkout@v1
87+
- name: download coverage report
88+
uses: actions/download-artifact@v2
89+
with:
90+
name: code-coverage-report
91+
- name: remove artifact coverage report
92+
uses: geekyeggo/delete-artifact@v1
93+
with:
94+
name: code-coverage-report
95+
- name: Install Coveralls
96+
run: composer global require php-coveralls/php-coveralls
97+
- name: Coveralls Finished
98+
env:
99+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
run: |
101+
mkdir -p ./build/logs/
102+
mv ./clover.xml ./build/logs/
103+
${COMPOSER_HOME}/vendor/bin/php-coveralls -v
104+
105+
finish-reademe:
106+
if: ${{ github.ref == 'refs/heads/master' }}
107+
needs: tests
108+
runs-on: ubuntu-latest
109+
steps:
110+
- uses: actions/checkout@v1
111+
- name: download oxrun-description
112+
uses: actions/download-artifact@v2
113+
with:
114+
name: oxrun-description
115+
- name: remove artifact oxrun-description
116+
uses: geekyeggo/delete-artifact@v1
117+
with:
118+
name: oxrun-description
119+
- name: commit readme
120+
run: |
121+
git config --global user.name "Github Action"
122+
git config --global user.email '[email protected]'
123+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
124+
git add ${GITHUB_WORKSPACE}/README.md
125+
git commit --message "Updated commands docu in README.md. (#$GITHUB_RUN_NUMBER) [ci skip]"
126+
git push -u origin HEAD:${{ github.ref }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ vendor
44
./oxid-esale
55
/build
66
composer.lock
7+
.phpunit.result.cache

.phpunit.result.cache

-1
This file was deleted.

.travis.yml

-40
This file was deleted.

0 commit comments

Comments
 (0)