https://github.com/RadioAstronomySoftwareGroup/pyuvdata
Raw File
Tip revision: 0b1b091eeec941c6081327cfd1d65f689feafd8c authored by Paul La Plante on 08 August 2020, 00:16 UTC
Merge branch 'Smithsonian-submillimeter_array' into master
Tip revision: 0b1b091
macosx_windows_ci.yaml
name: Run Tests
on: [push, pull_request]

jobs:
  tests:
    name: Run Tests
    env:
      PYTHON: ${{ matrix.python-version }}
    runs-on: ${{ matrix.os }}
    defaults:
     run:
       # Adding -l {0} helps ensure conda can be found properly in windows.
       shell: bash -l {0}
    strategy:
      fail-fast: false
      matrix:
        os: [macos-latest, windows-latest]
        python-version: [3.6, 3.7, 3.8]
    steps:
      - uses: actions/checkout@master
        with:
          fetch-depth: 1

      - name: Set ENV NAME
        run: |
          if [[ "${{ runner.os }}" = "Windows" ]]; then
            echo "::set-output name=ENV_NAME::pyuvdata_tests_windows"
          else
            echo "::set-output name=ENV_NAME::pyuvdata_tests"
          fi
        id: env_name

      - name: Setup Miniconda
        uses: goanpeca/setup-miniconda@v1.6.0
        with:
          auto-update-conda: "true"
          miniconda-version: "latest"
          python-version: ${{ matrix.python-version }}
          environment-file: ci/${{ steps.env_name.outputs.ENV_NAME }}.yml
          activate-environment: ${{ steps.env_name.outputs.ENV_NAME }}

      - name: Conda Info
        run: |
          conda info -a
          conda list
          PYVER=`python -c "import sys; print('{:d}.{:d}'.format(sys.version_info.major, sys.version_info.minor))"`
          if [[ $PYVER != $PYTHON ]]; then
            exit 1;
          fi

      - name: Install
        run: |
          pip install .

      - name: Run Tests
        run: |
          mkdir -p empty
          cd empty
          pytest --pyargs pyuvdata -c ../setup.cfg --cov=pyuvdata --cov-config=../.coveragerc --cov-report xml:../coverage.xml
          cd ..

      - name: Upload Coverage
        if: success()
        run: |
          bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
back to top