Skip to content

Migrate unit and integration tests from TravisCI to GitHub Actions #9

Migrate unit and integration tests from TravisCI to GitHub Actions

Migrate unit and integration tests from TravisCI to GitHub Actions #9

name: "Integration test"
# NOTE: We're just running the tests that require earthdata login here; we
# don't distinguish between unit and integration tests yet.
on:
pull_request:
paths:
- ".github/**"
- "icepyx/**/*.py"
- "pyproject.toml"
- "requirements*.txt"
push:
branches:
- "main"
- "development"
paths: # IMPORTANT: Keep in sync with pull request paths
- ".github/**"
- "icepyx/**/*.py"
- "pyproject.toml"
- "requirements*.txt"
jobs:
test:
name: "Test"
# Do not run on PRs from forks:
if: "${{ !github.event.pull_request.head.repo.fork }}"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
- uses: "./.github/actions/install-icepyx"
with:
python-version: "3.12"
- name: "Run tests"
env:
EARTHDATA_PASSWORD: "${{ secrets.EARTHDATA_PASSWORD }}"
NSIDC_LOGIN: "${{ secrets.EARTHDATA_PASSWORD }}"
run: |
pytest icepyx/ --verbose --cov app \
icepyx/tests/test_behind_NSIDC_API_login.py \
icepyx/tests/test_auth.py
- name: "Upload coverage report"
uses: "codecov/[email protected]"
with:
token: "${{ secrets.CODECOV_TOKEN }}"