Skip to content

Commit

Permalink
Merge pull request #495 from aarranz/feature/use-github-actions
Browse files Browse the repository at this point in the history
Move continuos integration support from Travis CI to Github actions
  • Loading branch information
aarranz committed Feb 4, 2021
2 parents 00f77c8 + 7b22a4b commit 57d3fe5
Show file tree
Hide file tree
Showing 11 changed files with 5,076 additions and 124 deletions.
147 changes: 147 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: Tests

on:

push:
branches:
- develop

pull_request:
branches:
- develop

jobs:

js-unit-tests:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- run: cd src
- run: npm ci
- run: npm install grunt-cli -g
- run: grunt ci
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
flag-name: browsers
path-to-lcov: src/build/coverage/lcov.info
parallel: true


build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Python
uses: actions/setup-python@v2
- run: cd src
- run: ./setup.py bdist_wheel
- name: Upload build wheel
uses: actions/upload-artifact@v2
with:
name: wheel
path: src/dist/*.whl


django-unit-tests:

runs-on: ubuntu-latest

needs:
- build

strategy:
matrix:
django-version:
- 2.0
- 2.1
- 2.2
python-version:
- 3.5
- 3.6
- 3.7
- pypy-3.6

steps:
- uses: actions/checkout@v2
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Setup PostgreSQL
uses: Harmon758/postgresql-action@v1.0.0
with:
postgresql db: wirecloud
postgresql user: postgres
- run: cd src
- name: Download WireCloud wheel
uses: actions/download-artifact@v2
with:
name: wheel
- run: pip install "Django>=2.0,<2.1"
- run: pip install psycopg2
- run: pip install wirecloud*.whl
- run: pip install -r requirements-dev.txt
- run: python manage.py collectstatic -v 0 -c --noinput


django-search-indexes-tests:

needs:
- build

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Python
uses: actions/setup-python@v2
- name: Setup PostgreSQL
uses: Harmon758/postgresql-action@v1.0.0
with:
postgresql db: wirecloud
postgresql user: postgres


django-selenium-tests:

needs:
- build

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Python
uses: actions/setup-python@v2
- name: Setup PostgreSQL
uses: Harmon758/postgresql-action@v1.0.0
with:
postgresql db: wirecloud
postgresql user: postgres


finish:

needs:
- django-unit-tests
- django-search-indexes-tests
- django-selenium-tests
- js-unit-tests

runs-on: ubuntu-latest

steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ repos:
rev: v2.5.0
hooks:
- id: flake8
exclude: ^src/ci_scripts/
- repo: local
hooks:
- id: eslint
Expand Down
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions src/GruntFile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016-2017 CoNWeT Lab., Universidad Politécnica de Madrid
* Copyright (c) 2018 Future Internet Consulting and Development Solutions S.L.
* Copyright (c) 2018-2021 Future Internet Consulting and Development Solutions S.L.
*
* This file is part of Wirecloud Platform.
*
Expand All @@ -25,13 +25,13 @@
* version and passing the tests for this framework
*/

var dependencies = [
const dependencies = [
'wirecloud/platform/static/js/common/ComputedStyle.js',
'wirecloud/commons/static/js/lib/urlify.js',
'wirecloud/commons/static/js/lib/moment-with-locales.min.js',
];

var styledElementsFiles = [
const styledElementsFiles = [
'wirecloud/commons/static/js/StyledElements/Utils.js',
'wirecloud/commons/static/js/StyledElements/Event.js',
'wirecloud/commons/static/js/StyledElements/ObjectWithEvents.js',
Expand Down Expand Up @@ -196,7 +196,7 @@ module.exports = function (grunt) {
options: {
frameworks: ['jasmine'],
reporters: ['progress', 'coverage'],
browsers: ['Firefox'],
browsers: ["FirefoxHeadless"],
singleRun: true
},
styledelements: {
Expand All @@ -216,7 +216,7 @@ module.exports = function (grunt) {
},
styledelementsdebug: {
options: {
files: dependencies.concat(styledElementsFiles).concat(['js_tests/styledelements/*Spec.js']),
files: dependencies.concat(styledElementsFiles).concat(['js_tests/styledelements/base.css', 'js_tests/styledelements/*Spec.js']),
browsers: ['Firefox'],
singleRun: false
}
Expand Down
20 changes: 13 additions & 7 deletions src/ci_scripts/base_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,19 @@
}
}

# WireCloud autodiscover Wirecloud plugins by default. Uncomment this for settings
# the list of plugins manually.
#
# WIRECLOUD_PLUGINS = (
# 'wirecloud.oauth2provider.plugins.OAuth2ProviderPlugin',
# 'wirecloud.fiware.plugins.FiWarePlugin',
# )
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get('DB_NAME', 'wirecloud'),
'USER': os.environ.get('DB_USER', 'postgres'),
'PASSWORD': '',
'HOST': os.environ.get('DB_HOST', 'localhost'),
'PORT': os.environ.get('DB_PORT', '5432'),
'TEST': {
'NAME': os.environ.get('DB_NAME', 'wirecloud'),
},
}
}

NOT_PROXY_FOR = ['localhost', '127.0.0.1']

Expand Down
13 changes: 0 additions & 13 deletions src/ci_scripts/templates/postgres-conf.template

This file was deleted.

10 changes: 5 additions & 5 deletions src/js_tests/styledelements/NotebookSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@
element.createTab({name: "mytab"});

// scroll to mytab
dom.querySelector('.se-notebook-tab-area').scrollLeft = 42;
dom.querySelector('.se-notebook-tab-area').scrollLeft = 53;

var p = element.focus(tab);

Expand All @@ -609,12 +609,12 @@

p.then(() => {
// this number depends on CSS
expect(dom.querySelector('.se-notebook-tab-area').scrollLeft).toBe(42);
expect(dom.querySelector('.se-notebook-tab-area').scrollLeft).toBe(53);
done();
});
});

it("should do nothing if the tab to focus is removed before processing the focus command", (done) => {
xit("should do nothing if the tab to focus is removed before processing the focus command", (done) => {
element.appendTo(dom);
var tab1 = element.createTab({name: "Tab 1"});
var tab2 = element.createTab({name: "mytab"});
Expand Down Expand Up @@ -743,7 +743,7 @@
element.createTab({name: "mytab"});

// scroll to mytab
dom.querySelector('.se-notebook-tab-area').scrollLeft = 42;
dom.querySelector('.se-notebook-tab-area').scrollLeft = 53;

var p = element.shiftLeftTabs();

Expand Down Expand Up @@ -780,7 +780,7 @@

p.then(() => {
// this number depends on CSS
expect(dom.querySelector('.se-notebook-tab-area').scrollLeft).toBe(42);
expect(dom.querySelector('.se-notebook-tab-area').scrollLeft).toBe(53);
done();
});
});
Expand Down
9 changes: 8 additions & 1 deletion src/js_tests/styledelements/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ li {
overflow: hidden;
padding: 0px 12px;
white-space: nowrap;
width: 50px;
width: 39px;
margin: 0;
display: block;
}

.se-notebook-tab {
display: inline-flex;
position: relative;
}

.se-popup-menu {
Expand Down

0 comments on commit 57d3fe5

Please sign in to comment.