diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 6f4fc2fbd43..c7bc5fd885f 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -63,191 +63,3 @@ jobs: make lint displayName: Linting (pylint) condition: succeededOrFailed() - - -# Mac -######################################################################################## -- job: - displayName: 'Mac' - - pool: - vmImage: 'macOS-10.14' - - variables: - CONDA_REQUIREMENTS: requirements.txt - CONDA_REQUIREMENTS_DEV: requirements-dev.txt - CONDA_INSTALL_EXTRA: "codecov gmt=6.0.0" - - strategy: - matrix: - Python38: - python.version: '3.8' - PYTHON: '3.8' - Python37: - python.version: '3.7' - PYTHON: '3.7' - Python36: - python.version: '3.6' - PYTHON: '3.6' - - steps: - - - bash: echo "##vso[task.prependpath]$CONDA/bin" - displayName: Add conda to PATH - - # Get the Fatiando CI scripts - - bash: git clone --branch=1.2.0 --depth=1 https://github.com/fatiando/continuous-integration.git - displayName: Fetch the Fatiando CI scripts - - # On Hosted macOS, the agent user doesn't have ownership of Miniconda's installation - # directory. We need to take ownership if we want to update conda or install packages - # globally. - - bash: sudo chown -R $USER $CONDA - displayName: Take ownership of conda installation - - # Setup dependencies and build a conda environment - - bash: source continuous-integration/azure/setup-miniconda.sh - displayName: Setup Miniconda - - # Show installed pkg information for postmortem diagnostic - - bash: | - set -x -e - source activate testing - conda list - displayName: List installed packages - - # Cache the ${HOME}/.gmt directory, for docs and testing - - task: Cache@2 - inputs: - key: cachedata | 20200524 - path: $(HOME)/.gmt - cacheHitVar: CACHE_CACHEDATA_RESTORED - displayName: Cache GMT remote data for testing - - # Download remote files, if not already cached - - bash: | - set -x -e - source activate testing - gmt which -Gu @earth_relief_10m @earth_relief_01d @ridge.txt @Table_5_11.txt @tut_bathy.nc @tut_quakes.ngdc @tut_ship.xyz - displayName: Download remote data - condition: ne(variables['CACHE_CACHEDATA_RESTORED'], true) - - # Install the package - - bash: | - set -x -e - source activate testing - python setup.py bdist_wheel - pip install dist/* - displayName: Install the package - - # Run the tests - - bash: | - set -x -e - source activate testing - make test PYTEST_EXTRA="-r P" - displayName: Test - - # Build the documentation - - bash: | - set -x -e - source activate testing - make -C doc clean all - displayName: Build the documentation - - # Upload test coverage if there were no failures - - bash: | - set -x -e - source activate testing - echo "Uploading coverage to Codecov" - codecov -e PYTHON AGENT_OS - env: - CODECOV_TOKEN: $(codecov.token) - condition: succeeded() - displayName: Upload coverage - - -# Windows -######################################################################################## -- job: - displayName: 'Windows' - - pool: - vmImage: 'vs2017-win2016' - - variables: - CONDA_REQUIREMENTS: requirements.txt - CONDA_REQUIREMENTS_DEV: requirements-dev.txt - CONDA_INSTALL_EXTRA: "codecov gmt=6.0.0" - - strategy: - matrix: - Python38: - python.version: '3.8' - PYTHON: '3.8' - Python37: - python.version: '3.7' - PYTHON: '3.7' - Python36: - python.version: '3.6' - PYTHON: '3.6' - - steps: - - - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" - displayName: Add conda to PATH - - # Get the Fatiando CI scripts - - script: git clone --branch=1.2.0 --depth=1 https://github.com/fatiando/continuous-integration.git - displayName: Fetch the Fatiando CI scripts - - # Setup dependencies and build a conda environment - - script: continuous-integration/azure/setup-miniconda.bat - displayName: Setup Miniconda - - # Show installed pkg information for postmortem diagnostic - - bash: | - set -x -e - source activate testing - conda list - displayName: List installed packages - - # Cache the ${HOME}/.gmt directory, for docs and testing - - task: Cache@2 - inputs: - key: cachedata | 20200524 - path: $(HOMEPATH)/.gmt - cacheHitVar: CACHE_CACHEDATA_RESTORED - displayName: Cache GMT remote data for testing - - # Download remote files, if not already cached - - bash: | - set -x -e - source activate testing - gmt which -Gu @earth_relief_10m @earth_relief_01d @ridge.txt @Table_5_11.txt @tut_bathy.nc @tut_quakes.ngdc @tut_ship.xyz - displayName: Download remote data - condition: ne(variables['CACHE_CACHEDATA_RESTORED'], true) - - # Install the package that we want to test - - bash: | - set -x -e - source activate testing - python setup.py sdist --formats=zip - pip install dist/* - displayName: Install the package - - # Run the tests - - bash: | - set -x -e - source activate testing - make test PYTEST_EXTRA="-r P" - displayName: Test - - # Upload test coverage if there were no failures - - bash: | - set -x -e - source activate testing - codecov -e PYTHON AGENT_OS - env: - CODECOV_TOKEN: $(codecov.token) - condition: succeeded() - displayName: Upload coverage diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 0708d53b775..82b7c193868 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -1,4 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python +# This workflow installs PyGMT dependencies, build documentation and run tests # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: Tests @@ -20,6 +20,10 @@ jobs: matrix: python-version: [3.6, 3.7, 3.8] os: [ubuntu-latest, macOS-latest, windows-latest] + # environmental variables used in coverage + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python-version }} steps: # Checkout current git repository @@ -45,6 +49,7 @@ jobs: cat << EOF >> $requirements_file gmt=6.0.0 make + codecov EOF conda install --yes --file $requirements_file @@ -96,3 +101,16 @@ jobs: - name: Test with pytest shell: bash -l {0} run: make test PYTEST_EXTRA="-r P" + + # Build the documentation + - name: Build the documentation + shell: bash -l {0} + run: make -C doc clean all + + # Upload coverage to Codecov + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.0.10 + with: + file: ./coverage.xml # optional + env_vars: OS,PYTHON + fail_ci_if_error: true