name: build

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Install dependencies
      run: |
        sudo make dev-install-no-model
        sudo pip3 install pytest-faulthandler
        sudo apt install xvfb
    - name: Lint with flake8
      run: |
        sudo pip3 install flake8
        # stop the build if there are Python syntax errors or undefined names
        flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
    - name: Test with pytest
      run: |
        sudo pip3 install pytest pytest-cov codecov
        xvfb-run --auto-servernum python3 -m pytest --cov=dragonfire/ --capture=sys --disable-pytest-warnings -vv
        # send the code coverage report to Codeconv
        codecov --token=${{ secrets.CODECOV_TOKEN }}

name: build

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Get pip cache
      id: pip-cache
      run: |
        python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"

    - uses: actions/cache@v1
      with:
        path: ${{ steps.pip-cache.outputs.dir }}
        key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
        restore-keys: |
          ${{ runner.os }}-pip-

    - uses: actions/checkout@v1
    - name: Install dependencies
      run: |
        sudo make dev-install-no-model
        sudo pip3 install pytest-faulthandler
        sudo apt install xvfb

    - name: Lint with flake8
      run: |
        sudo pip3 install flake8
        # stop the build if there are Python syntax errors or undefined names
        flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

    - name: Test with pytest
      run: |
        sudo pip3 install pytest pytest-cov codecov
        xvfb-run --auto-servernum python3 -m pytest --cov=dragonfire/ --capture=sys --disable-pytest-warnings -vv
        # send the code coverage report to Codeconv
        codecov --token=${{ secrets.CODECOV_TOKEN }}

Implement the pip cache for the CI build
Implement the pip cache for the CI build
