Skip to content

Commit 9cc3966

Browse files
MuhammadJaziralyWMDE bot
authored andcommitted
Replace Travis CI builds with github actions in WikibaseDataModel
Bug: T381168 Change-Id: Ib92d8e591e345dbf7a3a3f34153844781dd9e61f
1 parent 97319c3 commit 9cc3966

File tree

6 files changed

+88
-31
lines changed

6 files changed

+88
-31
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.gitattributes export-ignore
2+
.github/ export-ignore
23
.gitignore export-ignore
34
.scrutinizer.yml export-ignore
4-
.travis.yml export-ignore
55
composer.json export-ignore
66
docs export-ignore
77
phpmd.xml export-ignore
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CI workflow ${WORKFLOW} failed!
2+
3+
The failed job can be found in [here](${SERVER_URL}/${REPOSITORY}/actions/runs/${RUN_ID}).
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
name: Lint and Test
3+
on: push
4+
permissions:
5+
contents: read
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
php_version: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Setup PHP
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: ${{ matrix.php_version }}
18+
- uses: nowactions/envsubst@v1
19+
with:
20+
input: ${{ github.workspace }}/.github/workflows/ci_failure_email.md.tmpl
21+
output: ${{ github.workspace }}/.github/workflows/ci_failure_email.md
22+
env:
23+
WORKFLOW: ${{ github.workflow }}
24+
SERVER_URL: ${{ github.server_url }}
25+
REPOSITORY: ${{ github.repository }}
26+
RUN_ID: ${{ github.run_id }}
27+
- name: Validate composer.json and composer.lock
28+
run: composer validate --strict
29+
- name: Cache Composer packages
30+
id: composer-cache
31+
uses: actions/cache@v3
32+
with:
33+
path: vendor
34+
key: ${{ runner.os }}-php-${{ matrix.php_version}}-${{ hashFiles('**/composer.lock') }}
35+
- name: Install dependencies
36+
run: composer install --prefer-source --no-progress
37+
- name: Run test suite
38+
run: composer test
39+
- name: Send mail on failure
40+
if: ${{ failure() }}
41+
uses: dawidd6/action-send-mail@v3
42+
with:
43+
server_address: smtp.gmail.com
44+
server_port: 465
45+
username: ${{secrets.CI_MAIL_USERNAME}}
46+
password: ${{secrets.CI_MAIL_PASSWORD}}
47+
48+
from: ${{ github.repository }} CI
49+
subject: CI job failed for ${{ github.repository }}
50+
convert_markdown: true
51+
html_body: file://${{ github.workspace }}/.github/workflows/ci_failure_email.md

.github/workflows/scrutinize.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Generate and upload test coverage
2+
on:
3+
workflow_run:
4+
workflows: ['Lint and Test']
5+
types:
6+
- completed
7+
8+
jobs:
9+
scrutinize:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 2
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.0'
20+
coverage: xdebug
21+
- name: Cache Composer packages
22+
uses: actions/cache@v4
23+
with:
24+
path: vendor
25+
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
26+
- name: Generate PHP tests coverage
27+
run: vendor/bin/phpunit --coverage-clover coverage.clover
28+
- name: Upload Scrutinizer coverage
29+
uses: sudo-bot/action-scrutinizer@latest
30+
with:
31+
cli-args: "--repository g/wmde/WikibaseDataModel --format=php-clover ./coverage.clover"

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Wikibase DataModel
22

3-
[![Build Status](https://secure.travis-ci.org/wmde/WikibaseDataModel.png?branch=master)](http://travis-ci.org/wmde/WikibaseDataModel)
3+
[![Build Status](https://github.com/wmde/WikibaseDataModel/actions/workflows/lint-and-test.yaml/badge.svg?branch=master)](https://github.com/wmde/WikibaseDataModel/actions/workflows/lint-and-test.yaml)
44
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/wmde/WikibaseDataModel/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wmde/WikibaseDataModel/?branch=master)
55
[![Code Coverage](https://scrutinizer-ci.com/g/wmde/WikibaseDataModel/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/wmde/WikibaseDataModel/?branch=master)
66
[![Download count](https://poser.pugx.org/wikibase/data-model/d/total.png)](https://packagist.org/packages/wikibase/data-model)
@@ -83,7 +83,7 @@ Daniel Kinzler and Jeroen De Dauw.
8383
* [Wikibase DataModel on TravisCI](https://travis-ci.org/wmde/WikibaseDataModel)
8484
* [Wikibase DataModel on ScrutinizerCI](https://scrutinizer-ci.com/g/wmde/WikibaseDataModel)
8585
* [Wikibase DataModel on Wikimedia's Phabricator](https://phabricator.wikimedia.org/project/view/920/)
86-
86+
8787
## See also
8888

8989
* [Blog posts on Wikibase DataModel](http://www.bn2vs.com/blog/tag/wikibase-datamodel/)

0 commit comments

Comments
 (0)