name: Run tox
on: [pull_request, push]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - python-version: "2.7"
            env: docs
          - python-version: "2.7"
            env: flake8
    steps:
    - uses: actions/checkout@v2
    - name: install libsystemd-dev
      run: sudo apt-get install libsystemd-dev
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - uses: actions/cache@v1
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
        restore-keys: |
          ${{ runner.os }}-pip-
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install tox
    - name: Test with tox
      run: |
        tox -e ${{ matrix.env }}

name: Run tox
on: [pull_request, push]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - python-version: "2.7"
            env: docs
          - python-version: "2.7"
            env: flake8
    steps:
    - uses: actions/checkout@v2
    - name: update package index
      run: sudo apt-get update
    - name: install libsystemd-dev
      run: sudo apt-get install libsystemd-dev
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - uses: actions/cache@v1
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
        restore-keys: |
          ${{ runner.os }}-pip-
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install tox
    - name: Test with tox
      run: |
        tox -e ${{ matrix.env }}

Update the package index before installing libsystemd-dev
Update the package index before installing libsystemd-dev

Otherwise, the build will try to install an old version of libsystemd-dev,
that's not on the mirrors anymore.
