name: CI

on:
  # Need to also run on pushes to master since PRs from a fork won't have
  # access to the super user token, thereby skipping the tests
  push:
    branches:
      - master

  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: ${{ matrix.os }}
    env:
      REDCAPDEMO_SUPERUSER_TOKEN: ${{ secrets.REDCAPDEMO_SUPERUSER_TOKEN }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        python-version: ['3.7', '3.8', '3.9']

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Run poetry image
      uses: abatilo/actions-poetry@v2.0.0
      with:
        poetry-version: 1.1.11
    - name: Install dependencies
      run: |
        poetry install -E data_science
    - name: Run tests
      run: |
        poetry run pytest
    - name: Build docs
      run: |
        cd docs && poetry run make html
    - name: Upload coverage to Codecov
    - uses: actions/checkout@master
    - uses: codecov/codecov-action@v2
      with:
        token: ${{ secrets.CODECOV_TOKEN }}

name: CI

on:
  # Need to also run on pushes to master since PRs from a fork won't have
  # access to the super user token, thereby skipping the tests
  push:
    branches:
      - master

  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: ${{ matrix.os }}
    env:
      REDCAPDEMO_SUPERUSER_TOKEN: ${{ secrets.REDCAPDEMO_SUPERUSER_TOKEN }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        python-version: ['3.7', '3.8', '3.9']

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Run poetry image
      uses: abatilo/actions-poetry@v2.0.0
      with:
        poetry-version: 1.1.11
    - name: Install dependencies
      run: |
        poetry install -E data_science
    - name: Run tests
      run: |
        poetry run pytest
    - name: Build docs
      run: |
        cd docs && poetry run make html
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v2.1.0

Upgrade to latest codecov action
:arrow_up: Upgrade to latest codecov action
