From 2b5a8f02b20e30a25a759ea95d382e65acb27107 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Fri, 13 Nov 2020 19:04:27 +0000 Subject: [PATCH 01/25] experimentations with github workflows --- .github/workflows/build.yml | 58 ++++++++++++++++++++++++++ .github/workflows/windows_test.yml | 29 +++++++++++++ README.md | 5 ++- opal/core/test_runner.py | 4 +- opal/tests/js_config/karma_defaults.js | 4 +- opal/tests/test_core_test_runner.py | 12 +++--- runtests.py | 6 +-- 7 files changed, 103 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/windows_test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..f3d239775 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,58 @@ +on: [push, pull_request] +jobs: + # run python/js tests, coveralls and lint + integration-test: + name: Integration test ${{ matrix.os }} 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-16.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: python setup.py develop + - 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 + - run: find . -iname '*.info' -exec cp '{}' coverage \; + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: coverage/lcov.info + + + + + diff --git a/.github/workflows/windows_test.yml b/.github/workflows/windows_test.yml new file mode 100644 index 000000000..f31401a45 --- /dev/null +++ b/.github/workflows/windows_test.yml @@ -0,0 +1,29 @@ +on: [push, pull_request] +jobs: + # make sure the python side of things works on windows + other-os-tests: + name: Test ${{ matrix.os }} Python ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - windows-latest + 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: Install opal + run: python setup.py develop + - name: Install dependencies + run: pip install -r test-requirements.txt + - name: run tests + run: opal test py \ No newline at end of file diff --git a/README.md b/README.md index 2708783fa..12f753cbe 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ Opal ==== -[![Build Status](https://travis-ci.org/openhealthcare/opal.svg?branch=v0.11.0)](https://travis-ci.org/openhealthcare/opal) +![Integration tests](https://github.com/fredkingham/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. diff --git a/opal/core/test_runner.py b/opal/core/test_runner.py index 438d3e78a..4ded35847 100644 --- a/opal/core/test_runner.py +++ b/opal/core/test_runner.py @@ -10,7 +10,7 @@ from opal.utils import write -TRAVIS = os.environ.get('TRAVIS', False) +GITHUB_ACTION = os.environ.get('GITHUB_WORKFLOW', False) def _has_file(where, filename): @@ -84,7 +84,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' diff --git a/opal/tests/js_config/karma_defaults.js b/opal/tests/js_config/karma_defaults.js index aa29b451a..20a9bdf8b 100644 --- a/opal/tests/js_config/karma_defaults.js +++ b/opal/tests/js_config/karma_defaults.js @@ -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){ diff --git a/opal/tests/test_core_test_runner.py b/opal/tests/test_core_test_runner.py index 9acb7ed1a..7ae80bef0 100644 --- a/opal/tests/test_core_test_runner.py +++ b/opal/tests/test_core_test_runner.py @@ -148,10 +148,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): @@ -160,7 +160,7 @@ 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'], @@ -168,13 +168,13 @@ def test_run_tests(self, check_call): ) @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( [ @@ -198,7 +198,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( [ diff --git a/runtests.py b/runtests.py index 38c93b7f7..2e37ba1db 100644 --- a/runtests.py +++ b/runtests.py @@ -112,13 +112,13 @@ } ) -if 'TRAVIS' in os.environ: +if os.environ.get('GITHUB_WORKFLOW') == 'tests': 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', } } From 9ac99d527c9f6be22281c3b8a6ce7234b3a34c1e Mon Sep 17 00:00:00 2001 From: fredkingham Date: Mon, 16 Nov 2020 09:16:29 +0000 Subject: [PATCH 02/25] Remove the old travis file --- .travis.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8f32c81b4..000000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: python -dist: xenial -python: - - "3.5" - - "3.6" - - "3.7" - -services: - - postgresql - - xvfb -install: - - python setup.py develop - - gem install coveralls-lcov - - pip install -r test-requirements.txt - - npm install jasmine-core@2.3.4 karma@1.5 karma-coverage@1.1.1 karma-jasmine@0.3.8 karma-firefox-launcher@1.0.0 karma-coveralls@1.1.2 - - gem install rake -before_script: - - psql -c 'create database travis_ci_test;' -U postgres -script: - - opal test --coverage - - flake8 -after_success: - - ls -lha coverage - - coveralls-lcov -v -n coverage/Firefox\ 56.0.0\ \(Linux\ 0.0.0\)/lcov.info > coverage/coverage.json - - cat coverage/coverage.json - - coveralls debug --merge=coverage/coverage.json - - coveralls --merge=coverage/coverage.json -notifications: - slack: ohcuk:6spaME3CB7f2PGrMAcklYWqp -sudo: false From 77df11bfdc0532194b2c18502caa769529a1474f Mon Sep 17 00:00:00 2001 From: fredkingham Date: Mon, 16 Nov 2020 09:42:37 +0000 Subject: [PATCH 03/25] Coverralls tweaks to merge js and python --- .github/workflows/build.yml | 15 +++++++++------ opal/tests/test_core_test_runner.py | 1 + runtests.py | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3d239775..878c7a09e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,23 +34,26 @@ jobs: uses: actions/setup-ruby@v1 - name: Set up js uses: actions/setup-node@v1 + - run: gem install coveralls-lcov + - run: gem install rake - 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: python setup.py develop + env: + OPAL_TEST_USE_POSTGRES: 1 - name: Install dependencies run: pip install -r test-requirements.txt - run: gem install coveralls-lcov + - run: gem install rake - name: run tests run: opal test --coverage - name: flake8 run: flake8 - - run: find . -iname '*.info' -exec cp '{}' coverage \; - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: coverage/lcov.info + - run: coveralls-lcov -v -n coverage/Firefox\ 82.0.0\ \(Ubuntu\ 0.0.0\)/lcov.info > coverage/coverage.json + - run: coveralls --merge=coverage/coverage.json + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" diff --git a/opal/tests/test_core_test_runner.py b/opal/tests/test_core_test_runner.py index 7ae80bef0..ab1136f01 100644 --- a/opal/tests/test_core_test_runner.py +++ b/opal/tests/test_core_test_runner.py @@ -10,6 +10,7 @@ from opal.core import test_runner + class RunPyTestsTestCase(OpalTestCase): @patch('subprocess.check_call') diff --git a/runtests.py b/runtests.py index 2e37ba1db..51005863e 100644 --- a/runtests.py +++ b/runtests.py @@ -43,7 +43,7 @@ 'reversion.middleware.RevisionMiddleware' ), INSTALLED_APPS=( - 'django.contrib.auth', + 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.staticfiles', 'django.contrib.sessions', @@ -112,7 +112,7 @@ } ) -if os.environ.get('GITHUB_WORKFLOW') == 'tests': +if os.environ.get('USE_POSTGRES'): test_settings_config["DATABASES"] = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', From ae5a7f4596476d65e02ba6d95f7bc3e52fc66829 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Thu, 19 Nov 2020 15:00:57 +0000 Subject: [PATCH 04/25] remove the github windows test and combine things into work workflow build file that tests everything --- .github/workflows/build.yml | 27 +++++++++++++++++++++++++++ .github/workflows/windows_test.yml | 29 ----------------------------- 2 files changed, 27 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/windows_test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 878c7a09e..240640589 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,33 @@ jobs: - run: coveralls --merge=coverage/coverage.json env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" + # make sure the python side of things works on windows + other-os-tests: + name: Test ${{ matrix.os }} Python ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - windows-latest + 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: Install opal + run: python setup.py develop + - name: Install dependencies + run: pip install -r test-requirements.txt + - name: run tests + run: opal test py diff --git a/.github/workflows/windows_test.yml b/.github/workflows/windows_test.yml deleted file mode 100644 index f31401a45..000000000 --- a/.github/workflows/windows_test.yml +++ /dev/null @@ -1,29 +0,0 @@ -on: [push, pull_request] -jobs: - # make sure the python side of things works on windows - other-os-tests: - name: Test ${{ matrix.os }} Python ${{ matrix.python-version }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - windows-latest - 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: Install opal - run: python setup.py develop - - name: Install dependencies - run: pip install -r test-requirements.txt - - name: run tests - run: opal test py \ No newline at end of file From 5076533414f0205d2ba5a4e5362e996a26e4578b Mon Sep 17 00:00:00 2001 From: fredkingham Date: Thu, 19 Nov 2020 15:04:03 +0000 Subject: [PATCH 05/25] Add a comment as to why we are detecting the github workflow attribute --- opal/core/test_runner.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opal/core/test_runner.py b/opal/core/test_runner.py index 4ded35847..69efdb473 100644 --- a/opal/core/test_runner.py +++ b/opal/core/test_runner.py @@ -10,6 +10,9 @@ from opal.utils import write +# 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) From 0fe2645b99449521e8a7f4b0d6aec592eb3cef34 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Thu, 19 Nov 2020 15:36:50 +0000 Subject: [PATCH 06/25] Updates the readme to look at the opal repo's build --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 12f753cbe..dc1dfa3ee 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Opal ==== -![Integration tests](https://github.com/fredkingham/opal/workflows/.github/workflows/build.yml/badge.svg) +![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) From 93300561540cfaad7b2fc0f7b1b37ae32cc77dd4 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Thu, 19 Nov 2020 15:38:10 +0000 Subject: [PATCH 07/25] Remove appveyor this is covered by the gh action --- .appveyor.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 9250aa563..000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,18 +0,0 @@ -environment: - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - PYTHON: "C:\\Python36-x64" - PYTHON_VERSION: "3.6.*" - PYTHON_ARCH: "64" - -install: - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - "echo %PYTHON%" - # - "python -m pip install --disable-pip-version-check --user --upgrade pip" - - "python setup.py develop" - - "pip install -r test-requirements.txt" - -build: off - -test_script: - - "python runtests.py" From 70ed01ebd0f3219182394ba4bdc0e7f44242d77f Mon Sep 17 00:00:00 2001 From: fredkingham Date: Tue, 24 Nov 2020 19:13:45 +0000 Subject: [PATCH 08/25] Remove the duplicate line in the definition --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 240640589..fd947a15a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,8 +34,6 @@ jobs: uses: actions/setup-ruby@v1 - name: Set up js uses: actions/setup-node@v1 - - run: gem install coveralls-lcov - - run: gem install rake - 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 From ab211de930a867ed16decce0ce041b40dbfa2dbd Mon Sep 17 00:00:00 2001 From: fredkingham Date: Wed, 25 Nov 2020 09:14:37 +0000 Subject: [PATCH 09/25] Use the coverralls secret for pushing to coveralls --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd947a15a..1fa85b0bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,6 +52,7 @@ jobs: - 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: Test ${{ matrix.os }} Python ${{ matrix.python-version }} From be53e74cefa79e20e5876e496306f2df6ca67660 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Wed, 9 Dec 2020 10:36:28 +0000 Subject: [PATCH 10/25] try and avoid the tyranny of depending on firefox versions to find lcov.info --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1fa85b0bd..abfaaf9a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,8 @@ jobs: run: opal test --coverage - name: flake8 run: flake8 - - run: coveralls-lcov -v -n coverage/Firefox\ 82.0.0\ \(Ubuntu\ 0.0.0\)/lcov.info > coverage/coverage.json + - 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 }}" From 097a1d44107945911f58e4efee620684af40252e Mon Sep 17 00:00:00 2001 From: fredkingham Date: Fri, 26 Aug 2022 12:27:04 +0100 Subject: [PATCH 11/25] Fixes the Kombu version to 5.2.3 Celery allows Kombu 5.3 to be imported but that includes an import that does not work for python 3.6.9 (although celery should be supporting 3.6) --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index e51441c82..e4f413934 100644 --- a/setup.py +++ b/setup.py @@ -45,6 +45,8 @@ ] }, install_requires=[ + # We pin kombu because kombu 5.3 imports does not work on python 3.6.9 + 'kombu==5.2.3', 'ffs>=0.0.8.2', 'Jinja2==2.10.1', 'django==2.2.16', From 70563acaa4449c8c638465c5b0970412d7ded56d Mon Sep 17 00:00:00 2001 From: fredkingham Date: Fri, 26 Aug 2022 13:02:44 +0100 Subject: [PATCH 12/25] Change to use pip install --editable rather than python setup.py develop --- .github/workflows/build.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abfaaf9a4..b0b29aa49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: - 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: python setup.py develop + run: pip install -e . env: OPAL_TEST_USE_POSTGRES: 1 - name: Install dependencies @@ -76,13 +76,8 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install opal - run: python setup.py develop + run: pip install -e . - name: Install dependencies run: pip install -r test-requirements.txt - name: run tests run: opal test py - - - - - From 4fb63ef8fd69aacfabeecd46454da86979c015bd Mon Sep 17 00:00:00 2001 From: fredkingham Date: Fri, 26 Aug 2022 13:20:16 +0100 Subject: [PATCH 13/25] Downgrade Kombu to 5.1.0 Kombu 5.2.3 cannot be found on windows --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e4f413934..01dcd2a9f 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ }, install_requires=[ # We pin kombu because kombu 5.3 imports does not work on python 3.6.9 - 'kombu==5.2.3', + 'kombu==5.1.0', 'ffs>=0.0.8.2', 'Jinja2==2.10.1', 'django==2.2.16', From 76475e60ecd57912980de1597bf6cebad790947a Mon Sep 17 00:00:00 2001 From: fredkingham Date: Fri, 26 Aug 2022 13:37:16 +0100 Subject: [PATCH 14/25] Change the github actions to run on 18.04 We have no servers still running on ubuntu 16 and github don't support it, so use a more recent version of ubuntu --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0b29aa49..a9a724ddc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: - - ubuntu-16.04 + - ubuntu-18.04 python-version: - 3.6 - 3.7 From ef3f5388066224d00d0525c5f116c1f4ea512ec1 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Fri, 26 Aug 2022 17:49:58 +0100 Subject: [PATCH 15/25] Adds the coverralls completion action The coverralls completion action tells coverralls when to send the information about the coverrage back to github --- .github/workflows/build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9a724ddc..84bd30565 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,18 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + coveralls: + name: Indicate completion to coveralls.io + needs: integration-test + runs-on: ubuntu-latest + container: python:3-slim + steps: + - name: Finished + run: | + pip3 install --upgrade coveralls + coveralls --service=github --finish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # make sure the python side of things works on windows other-os-tests: name: Test ${{ matrix.os }} Python ${{ matrix.python-version }} From 0ac32fee06c4d8cbc981fc59c5b186a161ef9ca7 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Tue, 30 Aug 2022 08:55:41 +0100 Subject: [PATCH 16/25] Fixes indentations in the runtests file --- runtests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtests.py b/runtests.py index 9b755d5dc..f02748d22 100644 --- a/runtests.py +++ b/runtests.py @@ -43,7 +43,7 @@ 'reversion.middleware.RevisionMiddleware' ), INSTALLED_APPS=( - 'django.contrib.auth', + 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.staticfiles', 'django.contrib.sessions', From 5af5dc8e7257a17da6904865310b9fe4dbeb57e8 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Tue, 30 Aug 2022 12:40:32 +0100 Subject: [PATCH 17/25] Changes the version of ubuntu CI runs on to 20.04 Ubuntu 18.04 is deprecated and support will be removed Jan 23 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84bd30565..031c987ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: - - ubuntu-18.04 + - ubuntu-20.04 python-version: - 3.6 - 3.7 From 96660063ecf8b2d601092f908e2ca5a74fffbe0e Mon Sep 17 00:00:00 2001 From: fredkingham Date: Tue, 30 Aug 2022 16:56:24 +0100 Subject: [PATCH 18/25] Removes rake from the github actions --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 031c987ba..6121b6abb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,6 @@ jobs: - name: Install dependencies run: pip install -r test-requirements.txt - run: gem install coveralls-lcov - - run: gem install rake - name: run tests run: opal test --coverage - name: flake8 From e51ec733c040f2c0cb9d13ddf047631f9cc3ac5d Mon Sep 17 00:00:00 2001 From: fredkingham Date: Wed, 31 Aug 2022 08:46:01 +0100 Subject: [PATCH 19/25] Github workflows on windows only need to run on a single version --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6121b6abb..a9a131109 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,9 +75,6 @@ jobs: os: - windows-latest python-version: - - 3.6 - - 3.7 - - 3.8 - 3.9 steps: - name: Checkout From 9759a6a6266d29967e615eeb3082bf9ad779c824 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Wed, 31 Aug 2022 09:07:07 +0100 Subject: [PATCH 20/25] Removes the final coverralls step from the opal work flows as this is only used by coverralls in parallel task execution --- .github/workflows/build.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9a131109..7142a8b46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,18 +53,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - coveralls: - name: Indicate completion to coveralls.io - needs: integration-test - runs-on: ubuntu-latest - container: python:3-slim - steps: - - name: Finished - run: | - pip3 install --upgrade coveralls - coveralls --service=github --finish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # make sure the python side of things works on windows other-os-tests: name: Test ${{ matrix.os }} Python ${{ matrix.python-version }} From 7d65b776dd20407ba4c0dfadc70f3804d0ef7f6d Mon Sep 17 00:00:00 2001 From: fredkingham Date: Wed, 31 Aug 2022 09:15:47 +0100 Subject: [PATCH 21/25] Uses postgres on github actions CI except on windows Use a variable set by github to define whether we should use the CI's postgres as the test database --- .github/workflows/build.yml | 2 -- runtests.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7142a8b46..fabda70c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,8 +38,6 @@ jobs: 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 . - env: - OPAL_TEST_USE_POSTGRES: 1 - name: Install dependencies run: pip install -r test-requirements.txt - run: gem install coveralls-lcov diff --git a/runtests.py b/runtests.py index f02748d22..d67b3286e 100644 --- a/runtests.py +++ b/runtests.py @@ -113,7 +113,7 @@ } ) -if os.environ.get('USE_POSTGRES'): +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', From 0ca3305550eeb05d9f0943d87cfc047bde62c556 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Thu, 1 Sep 2022 21:03:17 +0100 Subject: [PATCH 22/25] Make the text of the github action appear slightly nicer --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fabda70c9..41529f212 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,9 @@ on: [push, pull_request] +name: CI jobs: # run python/js tests, coveralls and lint integration-test: - name: Integration test ${{ matrix.os }} python ${{ matrix.python-version }} + name: ${{ matrix.os }} python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} services: postgres: @@ -53,7 +54,7 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} # make sure the python side of things works on windows other-os-tests: - name: Test ${{ matrix.os }} Python ${{ matrix.python-version }} + name: ${{ matrix.os }} Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: fail-fast: false From b2269dd2f710dbfa0f1869997a160e954d264e49 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Thu, 1 Sep 2022 21:04:01 +0100 Subject: [PATCH 23/25] Makes CI action only fire on pull requests --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41529f212..61261bc84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -on: [push, pull_request] +on: [pull_request] name: CI jobs: # run python/js tests, coveralls and lint From 799ae5926f63e300948d727a09563d569fd11617 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Thu, 1 Sep 2022 21:04:42 +0100 Subject: [PATCH 24/25] Rename the action that runs the tests from build.yml to ci.yml --- .github/workflows/{build.yml => ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build.yml => ci.yml} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/ci.yml From 9a63e9f99ed4d8df1936771deae32507836a8272 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Thu, 1 Sep 2022 21:08:44 +0100 Subject: [PATCH 25/25] Slight renaming of the workflows to stop the duplicate use of ubuntu in the name and to make the windows capitalization of python match the ubuntu --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61261bc84..646167a71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI jobs: # run python/js tests, coveralls and lint integration-test: - name: ${{ matrix.os }} python ${{ matrix.python-version }} + name: python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} services: postgres: @@ -54,7 +54,7 @@ jobs: 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 }} + name: ${{ matrix.os }} python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: fail-fast: false