Skip to content

Commit

Permalink
Merge pull request #180 from shopwareLabs/migrate-to-github-action
Browse files Browse the repository at this point in the history
Migrate to GitHub actions
  • Loading branch information
mitelg committed Jul 13, 2021
2 parents 9a4a523 + 989c861 commit 7f7ad78
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 80 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yml
@@ -0,0 +1,38 @@
name: Deploy

on:
push:
branches: [ master ]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
ini-values: phar.readonly=Off

- name: Install dependencies
run: composer install --no-dev

- name: Build
run: ./bin/build.sh

- name: Deploy
run: |
mv sw.phar sw.phar.tmp
git config --global user.email "development@shopware.com"
git config --global user.name "shopwareBot"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git fetch origin
git checkout -t origin/gh-pages
mv sw.phar.tmp sw.phar
sha1sum sw.phar > sw.phar.version
git add sw.phar sw.phar.version
git commit -m 'Rebuilt phar'
git push origin gh-pages:gh-pages
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,34 @@
name: Test

on: [ push ]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
php: [ 7.2, 7.3, 7.4 ]
include:
- php: 7.2
upload-scrutinizer: true

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Install dependencies
run: composer install --no-interaction --prefer-source

- name: Execute tests
run: ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

- name: Upload to scrutinizer
if: ${{ matrix.upload-scrutinizer }}
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
4 changes: 0 additions & 4 deletions .gitignore
Expand Up @@ -16,10 +16,6 @@ sw.phar
sw.phar.pubkey
sw.phar.version

.travis/phar-private.pem
.travis/build-key.pem
.travis/secrets.tar

src/Extensions/
!src/Extensions/Shopware
output/
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

Binary file removed .travis/secrets.tar.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@

# Shopware CLI Tools

[![Build Status](https://img.shields.io/travis/shopwareLabs/sw-cli-tools/master.svg?style=flat-square)](https://travis-ci.org/shopwareLabs/sw-cli-tools)
[![Build Status](https://github.com/shopwareLabs/sw-cli-tools/actions/workflows/test.yml/badge.svg](https://github.com/shopwareLabs/sw-cli-tools/actions/workflows/test.yml)
[![Scrutinizer Score](https://img.shields.io/scrutinizer/g/shopwareLabs/sw-cli-tools.svg?style=flat-square)](https://scrutinizer-ci.com/g/shopwareLabs/sw-cli-tools)
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

Expand Down
12 changes: 12 additions & 0 deletions bin/build.sh
@@ -0,0 +1,12 @@
#!/bin/bash
set -e
set -o pipefail

# Remove some files from vendor directory
./bin/cleanup_vendor.sh

# Get box
./bin/download_box.sh

# Build PHAR
./box.phar build -vv
41 changes: 0 additions & 41 deletions bin/deploy.sh

This file was deleted.

2 changes: 1 addition & 1 deletion phpunit.xml.dist
Expand Up @@ -6,7 +6,7 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="test_bootstrap.php"
bootstrap="tests/test_bootstrap.php"
>

<testsuites>
Expand Down
3 changes: 2 additions & 1 deletion test_bootstrap.php → tests/test_bootstrap.php
Expand Up @@ -5,6 +5,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Composer\Autoload\ClassLoader;

final class TestLoaderProvider
Expand All @@ -29,5 +30,5 @@ public static function getLoader(): ClassLoader
}
}

$loader = require __DIR__ . '/vendor/autoload.php';
$loader = require __DIR__ . '/../vendor/autoload.php';
TestLoaderProvider::setLoader($loader);

0 comments on commit 7f7ad78

Please sign in to comment.