Skip to content

Commit a859641

Browse files
committed
Replace travis-ci with github actions in README
1 parent c6c176b commit a859641

File tree

1 file changed

+50
-19
lines changed

1 file changed

+50
-19
lines changed

README.md

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The command line utility will use an existing `git` repository to compare to cha
1717

1818
As this is still an alpha package, it is not suggested to include `php-semver-checker-git` directly in your composer.json. There are however a couple ways to use the tool:
1919

20-
1. **Preferred method** Download the [latest .phar build](http://psvcg.coreteks.org/php-semver-checker-git.phar). Note that the .phar build is generally less bleeding edge than the following methods.
20+
1. **Preferred method** Download the [latest .phar build](https://psvcg.coreteks.org/php-semver-checker-git.phar). Note that the .phar build is generally less bleeding edge than the following methods.
2121
2. `php composer.phar create-project tomzx/php-semver-checker-git --stability=dev` will clone to a new php-semver-checker-git folder in your current working directory
2222
3. `git clone https://github.com/tomzx/php-semver-checker-git.git` and `php composer.phar install` in the newly cloned directory.
2323

@@ -26,22 +26,43 @@ See the example section for examples of how to use the tool.
2626
### Building `php-semver-checker-git.phar`
2727
First, make sure you have [box](https://github.com/box-project/box2) installed. Then, in the base directory, you can run the following command which will generate the `php-semver-checker-git.phar` file.
2828

29-
```
29+
```bash
3030
box build
3131
```
3232

33-
### Using `php-semver-checker-git` with `travis-ci`
33+
### Using `php-semver-checker-git` with `GitHub actions`
3434

35-
It is very easy to add `php-semver-checker-git` to your build process and to get a nice report you can check in the `travis-ci` logs.
35+
It is very easy to add `php-semver-checker-git` to your build process and to get a nice report you can check in the `GitHub actions` logs.
36+
In a file under `.github/workflows/`, add the following:
3637

37-
```
38-
language: php
38+
```yaml
39+
name: Continuous integration
40+
41+
on: [push]
3942

40-
# Your configuration
43+
jobs:
44+
build:
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v2
50+
with:
51+
fetch-depth: 0
4152

42-
after_script:
43-
- wget http://psvcg.coreteks.org/php-semver-checker-git.phar
44-
- php php-semver-checker-git.phar suggest --allow-detached -vvv --details --include-before=src --include-after=src
53+
- name: Setup PHP
54+
uses: shivammathur/setup-php@v2
55+
with:
56+
php-version: ${{ matrix.php }}
57+
tools: composer:v2
58+
coverage: xdebug
59+
60+
# Your own CI configuration goes here
61+
62+
- name: Evaluate semantic versioning
63+
run: |
64+
wget https://psvcg.coreteks.org/php-semver-checker-git.phar
65+
php php-semver-checker-git.phar suggest -vvv --include-before=src --include-after=src --details --allow-detached
4566
```
4667
4768
In order to simplify the above call to `php-semver-checker-git`, we suggest you create a `php-semver-checker-git.yml` configuration file at the root of your project. In it, you can put the following:
@@ -53,16 +74,26 @@ include-before: src
5374
include-after: src
5475
```
5576

56-
With this configuration file, you can then use the following in your `.travis.yml` file.
77+
With this configuration file, you can update the configuration file created previously:
78+
79+
Before:
80+
```yaml
81+
# Your own CI configuration goes here
5782
83+
- name: Evaluate semantic versioning
84+
run: |
85+
wget https://psvcg.coreteks.org/php-semver-checker-git.phar
86+
php php-semver-checker-git.phar suggest -vvv --include-before=src --include-after=src --details --allow-detached
5887
```
59-
language: php
6088

61-
# Your configuration
89+
After:
90+
```yaml
91+
# Your own CI configuration goes here
6292
63-
after_script:
64-
- wget http://psvcg.coreteks.org/php-semver-checker-git.phar
65-
- php php-semver-checker-git.phar -vvv
93+
- name: Evaluate semantic versioning
94+
run: |
95+
wget https://psvcg.coreteks.org/php-semver-checker-git.phar
96+
php php-semver-checker-git.phar suggest -vvv
6697
```
6798

6899
## Example
@@ -80,16 +111,16 @@ php bin/php-semver-checker-git compare v1.6.4 v2.0.0 --include-before=src --incl
80111
php bin/php-semver-checker-git suggest --allow-detached --include-before=src --include-after=src
81112
```
82113

83-
Note: `--allow-detached` is very useful when you are running this command on [`travis-ci`](https://travis-ci.org) or any other continuous integration provider. It is necessary when a checkout is done on a particular commit, which makes `HEAD` become `detached`. If this option is not passed to the command, it will abort. This is done because it is impossible to revert the original `detached` branch when the `suggest` command completes.
114+
Note: `--allow-detached` is very useful when you are running this command on [`GitHub actions`](https://github.com/features/actions) or any other continuous integration provider. It is necessary when a checkout is done on a particular commit, which makes `HEAD` become `detached`. If this option is not passed to the command, it will abort. This is done because it is impossible to revert the original `detached` branch when the `suggest` command completes.
84115

85116
### Compare HEAD against a specific tag constraint
86117

87118
```bash
88119
php bin/php-semver-checker-git suggest --allow-detached --include-before=src --include-after=src --tag=~5.0
89120
```
90121

91-
Note: `--tag` supports any semantic versioning constraint such as `<`, `<=`, `>=`, '>', `~x.y.z` and `x.y.*`.
122+
Note: `--tag` supports any semantic versioning constraint such as `<`, `<=`, `>=`, '>', `~x.y.z`, `^x.y.z` `x.y.*`.
92123

93124
## License
94125

95-
The code is licensed under the [MIT license](http://choosealicense.com/licenses/mit/). See [LICENSE](LICENSE).
126+
The code is licensed under the [MIT license](https://choosealicense.com/licenses/mit/). See [LICENSE](LICENSE).

0 commit comments

Comments
 (0)