name: Run Tests & Build Docker Image

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  Tests:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.7, 3.8]
        node-version: [10.x, 12.x, 14.x]
    steps:
    - uses: actions/checkout@v2
    - name: Use Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: Set up virtual environment
      run: |
        pip install virtualenv
        virtualenv -p python${{ matrix.python-version }} venv/
    - name: Install Python dependencies
      run: venv/bin/pip install -r requirements.txt
    - name: Lint with flake8
      run: |
        # stop the build if there are Python syntax errors or undefined names
        venv/bin/flake8 c3bottles --count --select=E9,F63,F7,F82 --show-source --statistics
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
        venv/bin/flake8 c3bottles --count --exit-zero --max-line-length=127 --statistics
    - name: Test with pytest
      run: venv/bin/pytest --cov=c3bottles
    - name: Install JavaScript dependencies
      run: yarn
    - name: Build the JavaScript code
      run: yarn run build
  Docker:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Build the Docker image
      run: docker build . --file Dockerfile --target testrunner --tag c3bottles/testrunner
    - name: Run Python tests inside Docker
      run: docker run --rm c3bottles/testrunner pytest

Add Github workflow for test running & building the Docker image
Add Github workflow for test running & building the Docker image
