Crawlers #226
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: build | |
on: | |
pull_request: | |
push: | |
branches-ignore: | |
- 'gh_pages' | |
jobs: | |
conda-tests: | |
name: Test with conda (${{ matrix.os }}) Python ${{ matrix.python-version }}) | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
pip_cache_path: ~/.cache/pip | |
experimental: false | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
defaults: | |
run: | |
shell: bash -l {0} # For conda | |
env: | |
# Increase this value to reset cache if conda.yml and requirements.txt | |
# have not changed | |
CACHE_NUMBER: 0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache conda | |
uses: actions/cache@v2 | |
with: | |
path: ~/conda_pkgs_dir # from: conda-incubator/setup-miniconda@v2 | |
key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ | |
hashFiles('conda.yml') }} | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
path: ${{ matrix.pip_cache_path }} | |
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ | |
hashFiles('requirements.txt') }} | |
- name: Conda environment setup | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
activate-environment: pytoda | |
environment-file: conda.yml | |
auto-activate-base: false | |
use-only-tar-bz2: true # This needs to be set for proper caching | |
auto-update-conda: true # Required for windows for `use-only-tar-bz2` | |
- name: Conda list | |
run: conda list | |
- name: Install pytoda | |
run: | | |
pip install . | |
- name: Test & coverage report | |
run: | | |
pip install pytest | |
pip install pytest-cov | |
pytest -s --cov=./ --cov-report=xml | |
- name: Send Slack notification | |
uses: 8398a7/action-slack@v2 | |
if: always() | |
with: | |
status: ${{ job.status }} | |
text: "CI Build ${{ matrix.os }} Python ${{ matrix.python-version}}" | |
author_name: ${{ github.actor }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |