Skip to content

Commit

Permalink
Merge pull request #7674 from jonboiser/0.14.4-weekly7-into-develop
Browse files Browse the repository at this point in the history
0.14.4 weekly7 into develop
  • Loading branch information
rtibbles committed Nov 6, 2020
2 parents 6df6812 + 8d9b6d3 commit 032aa22
Show file tree
Hide file tree
Showing 35 changed files with 595 additions and 626 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/c_extensions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Static dependencies with and without C extensions

on:
push:
paths:
- '**.py'
- 'requirements/base.txt'
- 'requirements/build.txt'
pull_request:
paths:
- '**.py'
- 'requirements/base.txt'
- 'requirements/build.txt'

jobs:
c_ext:
name: C Extensions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 2.7
- name: pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-ext-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-ext
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/base.txt
pip install -r requirements/build.txt
pip install -r requirements/test.txt
- name: Check C extensions build and run
run: |
# Ensure that for this Python version, we can actually compile ALL files
# in the kolibri directory
python -m compileall -q kolibri -x py2only
# Until we have staged builds, we will be running this in each and every
# environment even though builds should be done in Py 2.7
make staticdeps
make staticdeps-cext
pip install .
# Start and stop kolibri
coverage run -p kolibri start --port=8081
coverage run -p kolibri stop
# Run just tests in test/
py.test --cov=kolibri --cov-report= --cov-append --color=no test/
no_c_ext:
name: No C Extensions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 2.7
- name: pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-no-ext-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-no-ext
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/base.txt
pip install -r requirements/build.txt
pip install -r requirements/test.txt
- name: Check No C extensions build and run
run: |
# Ensure that for this Python version, we can actually compile ALL files
# in the kolibri directory
python -m compileall -q kolibri -x py2only
# Until we have staged builds, we will be running this in each and every
# environment even though builds should be done in Py 2.7
make staticdeps
pip install .
# Start and stop kolibri
coverage run -p kolibri start --port=8081
coverage run -p kolibri stop
# Run just tests in test/
py.test --cov=kolibri --cov-report= --cov-append --color=no test/
32 changes: 32 additions & 0 deletions .github/workflows/check_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docs

on:
push:
paths:
- 'docs/**'
- 'requirements/docs.txt'
pull_request:
paths:
- 'docs/**'
- 'requirements/docs.txt'

jobs:
docs:
name: Checking docs build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-docs-${{ hashFiles('requirements/docs.txt') }}
restore-keys: |
${{ runner.os }}-pip-docs
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/docs.txt
- name: Check Docs build
run: make docs
21 changes: 21 additions & 0 deletions .github/workflows/check_licenses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Licenses

on:
push:
paths:
- 'requirements/*.txt'
pull_request:
paths:
- 'requirements/*.txt'

jobs:
licenses:
name: Licenses check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install dependencies
run: python -m pip install --upgrade pip
- name: Check Licenses
run: ./test/conditional/test_licenses.sh
40 changes: 40 additions & 0 deletions .github/workflows/no_zombies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: No zombie threads

on:
push:
paths:
- '**.py'
- 'requirements/base.txt'
pull_request:
paths:
- '**.py'
- 'requirements/base.txt'

jobs:
zombies:
name: No zombies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6
- name: pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-base-${{ hashFiles('requirements/base.txt') }}
restore-keys: |
${{ runner.os }}-pip-base
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/base.txt
pip install -r requirements/cext.txt
- name: Check proper shutdown
run: |
pip install .
# ensure kolibri stops within 20 seconds 10 times in a row
./test/ensure_kolibri_stops_within_time.sh 20 10 8082
./test/ensure_no_kolibris_running_on_port.sh 8082
37 changes: 37 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Linting

on:
push:
paths-ignore:
- '**.po'
- '**.json'
pull_request:
paths-ignore:
- '**.po'
- '**.json'


jobs:
linting:
name: All file linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: |
yarn --frozen-lockfile
npm rebuild node-sass
- uses: pre-commit/action@v2.0.0
27 changes: 27 additions & 0 deletions .github/workflows/python2lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Python 2 linting

on:
push:
paths:
- 'kolibri/**.py'
pull_request:
paths:
- 'kolibri/**.py'

jobs:
lint:
name: Python 2 syntax checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 2.7
uses: actions/setup-python@v2
with:
python-version: 2.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with flake8
run: |
flake8 kolibri
85 changes: 85 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Python tests

on:
push:
paths:
- '**.py'
- 'requirements/*.txt'
pull_request:
paths:
- '**.py'
- 'requirements/*.txt'

jobs:
unit_test:
name: Python unit tests
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: tox env cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-tox-py${{ matrix.python-version }}
- name: Test with tox
run: tox -e py${{ matrix.python-version }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
postgres:
name: Python postgres unit tests
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.5 for Postgres
uses: actions/setup-python@v2
with:
python-version: 3.5
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: tox env cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-tox-py${{ matrix.python-version }}
- name: Test with tox
run: tox -e postgres
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
40 changes: 40 additions & 0 deletions .github/workflows/yarn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Javascript Tests

on:
push:
paths:
- '**.vue'
- '**.js'
- 'yarn.lock'
pull_request:
paths:
- '**.vue'
- '**.js'
- 'yarn.lock'

jobs:
test:
name: Frontend tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: |
yarn --frozen-lockfile
npm rebuild node-sass
- name: Run tests
run: yarn run coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

0 comments on commit 032aa22

Please sign in to comment.