Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work flows #2012

Merged
merged 30 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2b5a8f0
experimentations with github workflows
Nov 13, 2020
9ac99d5
Remove the old travis file
Nov 16, 2020
77df11b
Coverralls tweaks to merge js and python
Nov 16, 2020
ae5a7f4
remove the github windows test and combine things into work workflow …
Nov 19, 2020
5076533
Add a comment as to why we are detecting the github workflow attribute
Nov 19, 2020
0fe2645
Updates the readme to look at the opal repo's build
Nov 19, 2020
9330056
Remove appveyor this is covered by the gh action
Nov 19, 2020
70ed01e
Remove the duplicate line in the definition
Nov 24, 2020
ab211de
Use the coverralls secret for pushing to coveralls
Nov 25, 2020
b694223
merging in v0.21.0
Nov 27, 2020
be53e74
try and avoid the tyranny of depending on firefox versions to find lc…
Dec 9, 2020
77f9103
Merge in v0.21.0 fix conflict as travis has been updated where as we …
Dec 17, 2020
bb6683e
Merges in v0.23.0
Jul 28, 2022
097a1d4
Fixes the Kombu version to 5.2.3
Aug 26, 2022
70563ac
Change to use pip install --editable rather than python setup.py develop
Aug 26, 2022
4fb63ef
Downgrade Kombu to 5.1.0
Aug 26, 2022
76475e6
Change the github actions to run on 18.04
Aug 26, 2022
5908ab3
Merge branch 'v0.23.0' into work-flows
Aug 26, 2022
2ff1e1f
Merge branch 'v0.23.0' into work-flows
Aug 26, 2022
ef3f538
Adds the coverralls completion action
Aug 26, 2022
0ac32fe
Fixes indentations in the runtests file
Aug 30, 2022
5af5dc8
Changes the version of ubuntu CI runs on to 20.04
Aug 30, 2022
9666006
Removes rake from the github actions
Aug 30, 2022
e51ec73
Github workflows on windows only need to run on a single version
Aug 31, 2022
9759a6a
Removes the final coverralls step from the opal work flows as this is…
Aug 31, 2022
7d65b77
Uses postgres on github actions CI except on windows
Aug 31, 2022
0ca3305
Make the text of the github action appear slightly nicer
Sep 1, 2022
b2269dd
Makes CI action only fire on pull requests
Sep 1, 2022
799ae59
Rename the action that runs the tests from build.yml to ci.yml
Sep 1, 2022
9a63e9f
Slight renaming of the workflows to stop the duplicate use of ubuntu …
Sep 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 0 additions & 18 deletions .appveyor.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
on: [pull_request]
name: CI
jobs:
# run python/js tests, coveralls and lint
integration-test:
name: python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ci_db_test
ports:
- 5432:5432
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up ruby for coveralls
uses: actions/setup-ruby@v1
- name: Set up js
uses: actions/setup-node@v1
- name: Install js dependencies
run: npm install jasmine-core@2.3.4 karma@1.5 karma-coverage@1.1.1 karma-jasmine@0.3.8 karma-firefox-launcher@2.1.0 karma-coveralls@1.1.2
- name: Install opal
run: pip install -e .
- name: Install dependencies
run: pip install -r test-requirements.txt
- run: gem install coveralls-lcov
- name: run tests
run: opal test --coverage
- name: flake8
run: flake8
- name: combine coveralls
run: find coverage -name "lcov.info" -exec coveralls-lcov -v -n {} \; > coverage/coverage.json
- run: coveralls --merge=coverage/coverage.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}"
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
# make sure the python side of things works on windows
other-os-tests:
name: ${{ matrix.os }} python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
python-version:
- 3.9
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install opal
run: pip install -e .
- name: Install dependencies
run: pip install -r test-requirements.txt
- name: run tests
run: opal test py
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Opal
====

[![Build Status](https://travis-ci.org/openhealthcare/opal.svg?branch=v0.11.0)](https://travis-ci.org/openhealthcare/opal)
![Build](https://github.com/openhealthcare/opal/workflows/.github/workflows/build.yml/badge.svg)

[![Coverage Status](https://coveralls.io/repos/github/openhealthcare/opal/badge.svg?branch=v0.11.0)](https://coveralls.io/github/openhealthcare/opal?branch=v0.11.0)
[![PyPI version](https://badge.fury.io/py/opal.svg)](https://badge.fury.io/py/opal)

[![PyPI version](https://badge.fury.io/py/opal.svg)](https://badge.fury.io/py/opal)

Opal is a full stack web framework that makes building digital tools for health care easy.

Expand Down
7 changes: 5 additions & 2 deletions opal/core/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

from opal.utils import write

TRAVIS = os.environ.get('TRAVIS', False)
# We're using the GITHUB_WORKFLOW env variable
# to determine that we are running in a github action.
# GITHUB_WORKFLOW is set in the env by github.
GITHUB_ACTION = os.environ.get('GITHUB_WORKFLOW', False)


def _has_file(where, filename):
Expand Down Expand Up @@ -84,7 +87,7 @@ def _run_js_tests(args):
# to a string
env["OPAL_LOCATION"] = str(args.opal_location)

if TRAVIS:
if GITHUB_ACTION:
karma = './node_modules/karma/bin/karma'
else:
karma = 'karma'
Expand Down
4 changes: 2 additions & 2 deletions opal/tests/js_config/karma_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ module.exports = function(includedFiles, baseDir, coverageFiles){
}
];

if(process.env.TRAVIS){
browsers = ["Firefox"];
if(process.env.GITHUB_WORKFLOW){
browsers = ["FirefoxHeadless"];
plugins.push("karma-firefox-launcher");
plugins.push("karma-coveralls");
if(useCoverage){
Expand Down
13 changes: 7 additions & 6 deletions opal/tests/test_core_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from opal.core import test_runner


class RunPyTestsTestCase(OpalTestCase):

@patch('subprocess.check_call')
Expand Down Expand Up @@ -148,10 +149,10 @@ def test_run_tests_for_unknown_config(self, sysexit, writer, has_file):
class RunJSTestsTestCase(OpalTestCase):

def setUp(self):
self.TRAVIS = test_runner.TRAVIS
self.GITHUB_ACTION = test_runner.GITHUB_ACTION

def tearDown(self):
test_runner.TRAVIS = self.TRAVIS
test_runner.GITHUB_ACTION = self.GITHUB_ACTION

@patch('subprocess.check_call')
def test_run_tests(self, check_call):
Expand All @@ -160,21 +161,21 @@ def test_run_tests(self, check_call):
mock_args.coverage = False
mock_args.test = None
mock_args.failfast = False
test_runner.TRAVIS = False
test_runner.GITHUB_ACTION = False
test_runner._run_js_tests(mock_args)
self.assertEqual(
['karma', 'start', 'config/karma.conf.js', '--single-run'],
check_call.call_args[0][0]
)

@patch('subprocess.check_call')
def test_run_tests_travis(self, check_call):
def test_run_tests_github(self, check_call):
mock_args = MagicMock(name="args")
mock_args.userland_here = ffs.Path('.')
mock_args.coverage = False
mock_args.test = None
mock_args.failfast = False
test_runner.TRAVIS = True
test_runner.GITHUB_ACTION = True
test_runner._run_js_tests(mock_args)
self.assertEqual(
[
Expand All @@ -198,7 +199,7 @@ def test_run_tests_failfast(self, check_call):
mock_args.coverage = False
mock_args.test = None
mock_args.failfast = True
test_runner.TRAVIS = False
test_runner.GITHUB_ACTION = False
test_runner._run_js_tests(mock_args)
self.assertEqual(
[
Expand Down
6 changes: 3 additions & 3 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@
}
)

if 'TRAVIS' in os.environ:
if os.environ.get('GITHUB_WORKFLOW') and not os.environ.get('RUNNER_OS') == 'Windows':
test_settings_config["DATABASES"] = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'travis_ci_test',
'NAME': 'ci_db_test',
'USER': 'postgres',
'PASSWORD': '',
'PASSWORD': 'postgres',
'HOST': 'localhost',
}
}
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
]
},
install_requires=[
# We pin kombu because kombu 5.3 imports does not work on python 3.6.9
'kombu==5.1.0',
'ffs>=0.0.8.2',
'Jinja2==2.10.1',
'django==2.2.16',
Expand Down