Skip to content

Commit 6fcc4cb

Browse files
authored
Move from Travis to GitHub Actions (#996)
1 parent 3bcb443 commit 6fcc4cb

File tree

9 files changed

+69
-48
lines changed

9 files changed

+69
-48
lines changed

.github/workflows/tests.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Run Tests
2+
on:
3+
# Triggers the workflow on pull request events but only for the main branch
4+
pull_request:
5+
branches: [ master ]
6+
types: [ opened, synchronize, reopened ]
7+
workflow_dispatch:
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
php-versions: ['5.6', '7.2', '7.4']
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v2
17+
18+
- name: Set up Node
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: '14'
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-versions }}
27+
tools: php-cs-fixer
28+
29+
- name: Get composer cache directory
30+
id: composer-cache
31+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
32+
33+
- name: Cache dependencies
34+
uses: actions/cache@v2
35+
with:
36+
path: ${{ steps.composer-cache.outputs.dir }}
37+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
38+
restore-keys: ${{ runner.os }}-composer-
39+
40+
- name: Install dependencies
41+
run: composer install --prefer-dist
42+
43+
- name: Install Node packages
44+
run: npm install -g eslint
45+
46+
- name: Run JS linter (eslint)
47+
run: eslint web/js
48+
49+
- name: Run PHP linter (php-cs-fixer)
50+
run: vendor/bin/php-cs-fixer --diff --dry-run -v fix
51+
52+
- name: Run tests
53+
run: |
54+
cp app/config/config.ini-ghactions app/config/config.ini
55+
vendor/atoum/atoum/bin/atoum -d tests/units/ --use-light-report
56+
php tests/functional/api.php
57+
php tests/functional/pages.php

.travis.yml

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

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Transvision
2-
[![Build Status](https://travis-ci.org/mozfr/transvision.svg?branch=master)](https://travis-ci.org/mozfr/transvision/)
32

43
Transvision is a Web application targeting the Mozilla localization community, created and maintained by the French Mozilla community (https://www.mozfr.org).
54

app/config/config.ini-dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ install=${TRANSVISIONDIR}/
1010
config=${TRANSVISIONDIR}/app/config
1111

1212
; URL to l10n web service. Wrap the value between quotes if the URL contains special characters like ~
13-
l10nwebservice='https://l10n.mozilla-community.org/mozilla-l10n-query/'
13+
l10nwebservice='https://flod.org/mozilla-l10n-query/mozilla-l10n-query/'
1414

1515
; Only needed for production setup
1616
local_hg=/temp

app/config/config.ini-dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ install=/home/pascalc/github/transvision
2323
config=/home/pascalc/repos/github/transvision/app/config
2424

2525
; URL to l10n web service. Wrap the value between quotes if the URL contains special characters like ~
26-
l10nwebservice = "https://l10n.mozilla-community.org/mozilla-l10n-query/"
26+
l10nwebservice = "https://flod.org/mozilla-l10n-query/mozilla-l10n-query/"
2727

2828
; Flag to know if we are working in production mode or development mode
2929
dev=false
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
[config]
22

3-
;TRAVIS_HOME will be replaced by the actual build dir in Travis
4-
53
; Path to the data root folder. TMX files will be stored in root/TMX so that
64
; they could be shared between multiple versions of Transvision
7-
root=TRAVIS_HOME/tests/testfiles/
5+
root=tests/testfiles/
86

97
; Path to Git checkout of Transvision, it will contain setup/update scripts
108
; and the web folder
11-
install=TRAVIS_HOME/
9+
install=./
1210

1311
; Path to configuration files for Transvision
14-
config=TRAVIS_HOME/app/config
12+
config=app/config
1513

1614
; URL to l10n web service. Wrap the value between quotes if the URL contains special characters like ~
17-
l10nwebservice = "https://l10n.mozilla-community.org/mozilla-l10n-query/"
15+
l10nwebservice = "https://flod.org/mozilla-l10n-query/mozilla-l10n-query/"
1816

1917
; Path to the local Mercurial clones, both en-US and l10n. Could be external
2018
; to the Git checkout of Transvision, as long as scripts have access to it.
21-
local_hg=TRAVIS_HOME/data/hg
19+
local_hg=data/hg
2220

2321
; Path to the local Git clones, both en-US and l10n. Could be external
2422
; to the Git checkout of Transvision, as long as scripts have access to it.
25-
local_git=TRAVIS_HOME/data/git
23+
local_git=data/git
2624

2725
; This path is used to store libraries (e.g. compare-locales)
28-
libraries=TRAVIS_HOME/data/libraries
26+
libraries=data/libraries
2927

3028
; Flag to know if we are working in production mode or development mode
3129
dev=true

app/views/credits.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<li><a href="https://getcomposer.org/">Composer</a>, a dependency manager for PHP projects</li>
1313
<li><a href="https://www.atoum.org/">Atoum</a>, a unit testing framework for PHP</li>
1414
<li><a href="https://www.jquery.com/">jQuery</a>, a JavaScript library</li>
15-
<li><a href="https://travis-ci.com/">Travis CI</a></li>
1615
</ul>
1716

1817
<p>The Transvision logo was created by Elio Qoshi from the <a href="https://github.com/mozilla/Community-Design">Mozilla Community Design team</a>.</p>

app/views/onestring.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
" <td><a class='onestring_search' href='{$search_link}' title='Search for the entity in this locale'>🔍</a></td>\n";
3838
}
3939

40-
"</tr>\n";
40+
echo "</tr>\n";
4141
}
4242
?>
4343
</table>

tests/units/Transvision/Utils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public function getRepoStringsDP()
267267
*/
268268
public function testGetRepoStrings($a, $b, $c)
269269
{
270-
if (! getenv('TRAVIS')) {
270+
if (! getenv('GITHUB_ACTIONS')) {
271271
$obj = new _Utils();
272272
$this
273273
->array($obj->getRepoStrings($a, $b))
@@ -388,7 +388,7 @@ public function agoDP()
388388
If running tests locally, check also the behavior without providing
389389
a reference date.
390390
*/
391-
if (! getenv('TRAVIS')) {
391+
if (! getenv('GITHUB_ACTIONS')) {
392392
$data = array_merge(
393393
$data,
394394
[

0 commit comments

Comments
 (0)