Skip to content

Commit

Permalink
Move from Travis to GitHub Actions (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
flodolo committed Dec 19, 2020
1 parent 3bcb443 commit 6fcc4cb
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 48 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Run Tests
on:
# Triggers the workflow on pull request events but only for the main branch
pull_request:
branches: [ master ]
types: [ opened, synchronize, reopened ]
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['5.6', '7.2', '7.4']
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: php-cs-fixer

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist

- name: Install Node packages
run: npm install -g eslint

- name: Run JS linter (eslint)
run: eslint web/js

- name: Run PHP linter (php-cs-fixer)
run: vendor/bin/php-cs-fixer --diff --dry-run -v fix

- name: Run tests
run: |
cp app/config/config.ini-ghactions app/config/config.ini
vendor/atoum/atoum/bin/atoum -d tests/units/ --use-light-report
php tests/functional/api.php
php tests/functional/pages.php
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Transvision
[![Build Status](https://travis-ci.org/mozfr/transvision.svg?branch=master)](https://travis-ci.org/mozfr/transvision/)

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

Expand Down
2 changes: 1 addition & 1 deletion app/config/config.ini-dev
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ install=${TRANSVISIONDIR}/
config=${TRANSVISIONDIR}/app/config

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

; Only needed for production setup
local_hg=/temp
Expand Down
2 changes: 1 addition & 1 deletion app/config/config.ini-dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ install=/home/pascalc/github/transvision
config=/home/pascalc/repos/github/transvision/app/config

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

; Flag to know if we are working in production mode or development mode
dev=false
Expand Down
16 changes: 7 additions & 9 deletions app/config/config.ini-travis → app/config/config.ini-ghactions
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
[config]

;TRAVIS_HOME will be replaced by the actual build dir in Travis

; Path to the data root folder. TMX files will be stored in root/TMX so that
; they could be shared between multiple versions of Transvision
root=TRAVIS_HOME/tests/testfiles/
root=tests/testfiles/

; Path to Git checkout of Transvision, it will contain setup/update scripts
; and the web folder
install=TRAVIS_HOME/
install=./

; Path to configuration files for Transvision
config=TRAVIS_HOME/app/config
config=app/config

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

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

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

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

; Flag to know if we are working in production mode or development mode
dev=true
1 change: 0 additions & 1 deletion app/views/credits.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<li><a href="https://getcomposer.org/">Composer</a>, a dependency manager for PHP projects</li>
<li><a href="https://www.atoum.org/">Atoum</a>, a unit testing framework for PHP</li>
<li><a href="https://www.jquery.com/">jQuery</a>, a JavaScript library</li>
<li><a href="https://travis-ci.com/">Travis CI</a></li>
</ul>

<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>
Expand Down
2 changes: 1 addition & 1 deletion app/views/onestring.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
" <td><a class='onestring_search' href='{$search_link}' title='Search for the entity in this locale'>🔍</a></td>\n";
}

"</tr>\n";
echo "</tr>\n";
}
?>
</table>
Expand Down
4 changes: 2 additions & 2 deletions tests/units/Transvision/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public function getRepoStringsDP()
*/
public function testGetRepoStrings($a, $b, $c)
{
if (! getenv('TRAVIS')) {
if (! getenv('GITHUB_ACTIONS')) {
$obj = new _Utils();
$this
->array($obj->getRepoStrings($a, $b))
Expand Down Expand Up @@ -388,7 +388,7 @@ public function agoDP()
If running tests locally, check also the behavior without providing
a reference date.
*/
if (! getenv('TRAVIS')) {
if (! getenv('GITHUB_ACTIONS')) {
$data = array_merge(
$data,
[
Expand Down

0 comments on commit 6fcc4cb

Please sign in to comment.