Skip to content

Commit 50311c9

Browse files
authored
Merge pull request #5 from bitbull-team/feature/github-actions
Add GitHub Actions
2 parents cd8455d + c23cc33 commit 50311c9

File tree

4 files changed

+236
-33
lines changed

4 files changed

+236
-33
lines changed

.github/workflows/php.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: PHP Validation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
run:
13+
runs-on: '${{ matrix.operating-system }}'
14+
strategy:
15+
matrix:
16+
operating-system:
17+
- ubuntu-latest
18+
php-versions:
19+
- '7.2'
20+
- '7.3'
21+
- '7.4'
22+
name: 'PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}'
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: '${{ matrix.php-versions }}'
30+
extensions: 'mbstring, intl'
31+
ini-values: 'post_max_size=256M, short_open_tag=On'
32+
coverage: pcov
33+
tools: 'php-cs-fixer, phpunit'
34+
- name: Validate composer.json and composer.lock
35+
run: composer validate
36+
- name: Cache Composer packages
37+
id: composer-cache
38+
uses: actions/cache@v2
39+
with:
40+
path: vendor
41+
key: '${{ runner.os }}-php-${{ hashFiles(''**/composer.lock'') }}'
42+
restore-keys: |
43+
${{ runner.os }}-php-
44+
- name: Install dependencies
45+
if: steps.composer-cache.outputs.cache-hit != 'true'
46+
run: composer install --prefer-dist --no-progress --no-suggest

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
name: Create GitHub Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@master
15+
- name: Get version tag
16+
id: get_version
17+
run: 'echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}'
18+
- name: Create Release
19+
uses: actions/create-release@latest
20+
env:
21+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
22+
with:
23+
tag_name: '${{ steps.get_version.outputs.VERSION }}'
24+
release_name: 'Version ${{ steps.get_version.outputs.VERSION }}'
25+
draft: false
26+
prerelease: false

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
],
1111
"require": {
12-
"php": "~7.2.0|~7.3.0",
12+
"php": "~7.2.0|~7.3.0|~7.4.0",
1313
"aws/aws-sdk-php": "^3.110"
1414
},
1515
"type": "magento2-module",

0 commit comments

Comments
 (0)