diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7912112c..f6852e4c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,12 +4,12 @@ on: [push, pull_request] jobs: build: - - runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + platform: [ ubuntu-latest, macos-latest ] + python-version: ["3.7", "3.8", "3.9", "3.10"] + runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/codacy-coverage-reporter.yaml b/.github/workflows/codacy-coverage-reporter.yaml index 72e640ce..b0a8f90d 100644 --- a/.github/workflows/codacy-coverage-reporter.yaml +++ b/.github/workflows/codacy-coverage-reporter.yaml @@ -2,16 +2,32 @@ # For more information see: https://github.com/codacy/codacy-coverage-reporter-action name: PyLops-coverage -on: [push, pull_request] +on: [push, pull_request_target] jobs: - codacy-coverage-reporter: + build: + runs-on: ubuntu-latest - name: codacy-coverage-reporter steps: - - uses: actions/checkout@v3 - - name: Run codacy-coverage-reporter - uses: codacy/codacy-coverage-reporter-action@v1 - with: - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - coverage-reports: ./ + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest coverage + if [ -f requirements.txt ]; then pip install -r requirements-dev.txt; fi + - name: Install pylops + run: | + pip install . + - name: Code coverage with coverage + run: | + coverage run -m pytest + coverage xml + - name: Run codacy-coverage-reporter + uses: codacy/codacy-coverage-reporter-action@v1 + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: coverage.xml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b3015acc..00000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: python - -python: - - "3.8" - -os: - - linux - -script: - - pip3 install --upgrade setuptools - - pip3 install -r requirements-dev.txt - - pip3 install coverage codacy-coverage - - pip3 install . - - python3 setup.py test - -after_success: - - 'if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then coverage run setup.py test; coverage xml; bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml; fi' diff --git a/Makefile b/Makefile index 65464758..0ac4b3d5 100755 --- a/Makefile +++ b/Makefile @@ -48,3 +48,6 @@ lint: typeannot: mypy pylops/ + +coverage: + coverage run -m pytest && coverage xml && coverage html && $(PYTHON) -m http.server --directory htmlcov/