name: Build

on:
  - push
  - pull_request

env:
  GITHUB_WORKFLOW: true

jobs:
  test:
    name: Test and coverage
    runs-on: ubuntu-20.04

    strategy:
      fail-fast: false
      matrix:
        python-version:
          - 3.6
          - 3.7
          - 3.8
          - 3.9
        django:
          - 2.2
          - 3.1
          - 3.2

    steps:
      - uses: actions/checkout@v2

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

      - name: Update pip
        run: python -m pip install --upgrade pip

      - name: Install Django 2.2
        if: matrix.django == 2.2
        run: pip install "Django>=2.2,<3.0"
      - name: Install Django 3.0
        if: matrix.django == 3.0
        run: pip install "Django>=3.0,<3.1"
      - name: Install Django 3.1
        if: matrix.django == 3.1
        run: pip install "Django>=3.1,<3.2"
      - name: Install Django 3.2
        if: matrix.django == 3.2
        run: pip install "Django>=3.2,<3.3"

      - name: Install requirements
        run: pip install -r requirements_test.txt

      - name: Install package
        run: pip install -e .

      - name: Run tests and coverage
        run: coverage run --source=highlightjs manage.py test

      - name: Publish coverage
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
        run: coveralls
Add github actions to replace travis ci
Add github actions to replace travis ci
