diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 000000000000..cfd484957141 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,69 @@ +# Perform linting, code style checking, and unit tests on mycroft-core +# +# This is only part of the continuous integration (CI) process for mycroft-core +# behavioral tests (Voight-Kampff) are run in a Jenkins job. +name: Unit Tests + +on: + push: + branches: + - dev + - master + pull_request: + branches: + - dev + - master + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + # Run for all versions of Python officially supported by mycroft-core + python-version: [3.6, 3.7, 3.8, 3.9] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Cache pip packages + uses: actions/cache@v2 + env: + cache-name: cache-pypi-modules + with: + # pip cache files are stored in `~/.cache/pip` on Linux + path: ~/.cache/pip + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('requirements/requirements.txt', 'requirements/tests.txt') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Install compilers + run: | + sudo apt-get update -qq + sudo apt-get install -y gcc-4.8 g++-4.8 + - name: Install Python packages for testing + run: pip install -r requirements/tests.txt + - name: Setup mycroft core + # Only build mimic for one Python version; others should not differ + run: | + if [[ ${{ matrix.python-version }} == 3.9 ]]; then ./dev_setup.sh; fi + if [[ ${{ matrix.python-version }} != 3.9 ]]; then ./dev_setup.sh -sm; fi + env: + CC: gcc-4.8 + CI: true + - name: Linting and code style + run: | + pycodestyle mycroft test + flake8 mycroft test --count --select=E9,F63,F7,F82 --show-source --statistics + - name: Run unit tests + # Only generate the html report for one of the versions, others should not differ + run: | + if [[ ${{ matrix.python-version }} == 3.9 ]]; then ./start-mycroft.sh unittest --cov-report html; fi + if [[ ${{ matrix.python-version }} != 3.9 ]]; then ./start-mycroft.sh unittest; fi + - name: Upload code coverage + # Only upload the report for the Python version that generated it + run: if [[ ${{ matrix.python-version }} == 3.9 ]]; then bash <(curl -s https://codecov.io/bash); fi + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 1665b0a68dd5..01958ef2c736 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,19 @@ -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE.md) [![CLA](https://img.shields.io/badge/CLA%3F-Required-blue.svg)](https://mycroft.ai/cla) [![Team](https://img.shields.io/badge/Team-Mycroft_Core-violetblue.svg)](https://github.com/MycroftAI/contributors/blob/master/team/Mycroft%20Core.md) ![Status](https://img.shields.io/badge/-Production_ready-green.svg) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE.md) +[![CLA](https://img.shields.io/badge/CLA%3F-Required-blue.svg)](https://mycroft.ai/cla) +[![Team](https://img.shields.io/badge/Team-Mycroft_Core-violetblue.svg)](https://github.com/MycroftAI/contributors/blob/master/team/Mycroft%20Core.md) +![Status](https://img.shields.io/badge/-Production_ready-green.svg) -[![Build Status](https://travis-ci.org/MycroftAI/mycroft-core.svg?branch=master)](https://travis-ci.org/MycroftAI/mycroft-core) [![Coverage Status](https://coveralls.io/repos/github/MycroftAI/mycroft-core/badge.svg?branch=dev)](https://coveralls.io/github/MycroftAI/mycroft-core?branch=dev) +![Unit Tests](https://github.com/mycroftai/mycroft-core/workflows/Unit%20Tests/badge.svg) +[![codecov](https://codecov.io/gh/MycroftAI/mycroft-core/branch/dev/graph/badge.svg?token=zQzRlkXxAr)](https://codecov.io/gh/MycroftAI/mycroft-core) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) [![Join chat](https://img.shields.io/badge/Mattermost-join_chat-brightgreen.svg)](https://chat.mycroft.ai) -Mycroft -========== +# Mycroft Mycroft is a hackable open source voice assistant. -# Table of Contents +## Table of Contents -- [Table of Contents](#table-of-contents) - [Getting Started](#getting-started) - [Running Mycroft](#running-mycroft) - [Using Mycroft](#using-mycroft) @@ -28,7 +30,7 @@ Mycroft is a hackable open source voice assistant. - [Getting Involved](#getting-involved) - [Links](#links) -# Getting Started +## Getting Started First, get the code on your system! The simplest method is via git ([git installation instructions](https://gist.github.com/derhuerst/1b15ff4652a867391f03)): - `cd ~/` @@ -43,7 +45,7 @@ This script sets up dependencies and a [virtualenv][about-virtualenv]. If runni NOTE: The default branch for this repository is 'dev', which should be considered a work-in-progress. If you want to clone a more stable version, switch over to the 'master' branch. -# Running Mycroft +## Running Mycroft Mycroft provides `start-mycroft.sh` to perform common tasks. This script uses a virtualenv created by `dev_setup.sh`. Assuming you installed mycroft-core in your home directory run: - `cd ~/mycroft-core` @@ -54,27 +56,27 @@ The "debug" command will start the background services (microphone listener, ski The background services can be stopped as a group with: - `./stop-mycroft.sh` -# Using Mycroft +## Using Mycroft -## *Home* Device and Account Manager +### *Home* Device and Account Manager Mycroft AI, Inc. maintains a device and account management system known as Mycroft Home. Developers may sign up at: https://home.mycroft.ai By default, mycroft-core is configured to use Home. By saying "Hey Mycroft, pair my device" (or any other request verbal request) you will be informed that your device needs to be paired. Mycroft will speak a 6-digit code which you can enter into the pairing page within the [Mycroft Home site](https://home.mycroft.ai). Once paired, your unit will use Mycroft API keys for services such as Speech-to-Text (STT), weather and various other skills. -## Skills +### Skills -Mycroft is nothing without skills. There are a handful of default skills that are downloaded automatically to your `/opt/mycroft/skills` directory, but most need to be installed explicitly. See the [Skill Repo](https://github.com/MycroftAI/mycroft-skills#welcome) to discover skills made by others. And please share your own interesting work! +Mycroft is nothing without skills. There are a handful of default skills that are downloaded automatically to your `/opt/mycroft/skills` directory, but most need to be installed explicitly. See the [Skill Repo](https://github.com/MycroftAI/mycroft-skills#welcome) to discover skills made by others. Please share your own interesting work! -# Behind the scenes +## Behind the scenes -## Pairing Information +### Pairing Information Pairing information generated by registering with Home is stored in: `~/.mycroft/identity/identity2.json` <-- DO NOT SHARE THIS WITH OTHERS! -## Configuration -Mycroft configuration consists of 4 possible locations: +### Configuration +Mycroft's configuration consists of 4 possible locations: - `mycroft-core/mycroft/configuration/mycroft.conf`(Defaults) - [Mycroft Home](https://home.mycroft.ai) (Remote) - `/etc/mycroft/mycroft.conf`(Machine) @@ -82,7 +84,7 @@ Mycroft configuration consists of 4 possible locations: When the configuration loader starts, it looks in these locations in this order, and loads ALL configurations. Keys that exist in multiple configuration files will be overridden by the last file to contain the value. This process results in a minimal amount being written for a specific device and user, without modifying default distribution files. -## Using Mycroft Without Home +### Using Mycroft Without Home If you do not wish to use the Mycroft Home service, before starting Mycroft for the first time, create `$HOME/.mycroft/mycroft.conf` with the following contents: @@ -111,7 +113,7 @@ You may insert your own API keys into the configuration files listed above in