name: Run Securesystemslib tests

on: [push, pull_request, workflow_dispatch]

jobs:
  build:
    strategy:
      fail-fast: false
      # Run tests on each OS/Python combination
      matrix:
        python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
        # TODO: Add windows-latest when gpg issues are solved
        os: [ubuntu-latest, macos-latest]
        toxenv: [py]

        # TODO add special cases: purepy27, purepy38, py27-no-gpg, py38-no-gpg

    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout securesystemslib
        uses: actions/checkout@v2

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Find pip cache dir
        id: pip-cache
        run: echo "::set-output name=dir::$(pip cache dir)"

      - name: pip cache
        uses: actions/cache@v2
        with:
          # Use the os dependent pip cache directory found above
          path: ${{ steps.pip-cache.outputs.dir }}
          # A match with 'key' counts as cache hit
          key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
          # A match with 'restore-keys' is used as fallback
          restore-keys: ${{ runner.os }}-pip-

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install --upgrade tox

      - name: Run tox
        run: tox -e ${{ matrix.toxenv }}


Add initial Github Actions CI workflow
Add initial Github Actions CI workflow

Windows is disabled since there are multiple failures currently.

The special cases (purepy27, purepy38, py27-no-gpg, py38-no-gpg) are not
handled.

Coveralls is not integrated.
