Skip to content

Commit 25e86ff

Browse files
authored
Merge pull request #1 from pelanis/ONBRD-1048-github-actions-usage
GitHub actions usage
2 parents 7dbfc1c + d69d805 commit 25e86ff

File tree

3 files changed

+79
-38
lines changed

3 files changed

+79
-38
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
tags: [ '*' ]
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
php-version: ['7.4']
16+
include:
17+
- php-version: '7.4'
18+
release: true
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-version }}
27+
coverage: none
28+
tools: composer:v1
29+
30+
- name: Get composer cache directory
31+
id: composer-cache
32+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
33+
34+
- name: Cache dependencies
35+
uses: actions/cache@v3
36+
with:
37+
path: ${{ steps.composer-cache.outputs.dir }}
38+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
39+
restore-keys: ${{ runner.os }}-composer-
40+
41+
- name: Install dependencies
42+
run: composer install --no-interaction --prefer-dist
43+
env:
44+
COMPOSER_MEMORY_LIMIT: -1
45+
46+
- name: Run tests
47+
run: |
48+
bin/phpunit
49+
bin/raml-code-generator
50+
composer run compile
51+
dist/raml-code-generator.phar
52+
53+
- name: Upload artifact
54+
if: matrix.release && startsWith(github.ref, 'refs/tags/')
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: phar-artifact
58+
path: dist/raml-code-generator.phar
59+
60+
release:
61+
needs: test
62+
if: startsWith(github.ref, 'refs/tags/')
63+
runs-on: ubuntu-latest
64+
65+
steps:
66+
- name: Download artifact
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: phar-artifact
70+
path: dist
71+
72+
- name: Create Release
73+
uses: softprops/action-gh-release@v1
74+
with:
75+
files: dist/raml-code-generator.phar

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## 11.11.1
8+
### Changed
9+
- Migrated from Travis CI to GitHub Actions
10+
711
## 11.11.0
812
### Added
913
- 202 responses can now return a body.

0 commit comments

Comments
 (0)