User agent update (#4) #22
This file contains hidden or 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: run_tests | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
unittest: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ["3.11", "3.12", "3.13"] | |
test-subset: | |
- | | |
tests/ | |
runs-on: ${{ matrix.os }} | |
env: | |
TEST_SUBSET: ${{ matrix.test-subset }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
env: | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-py${{matrix.python-version}}-conda-${{ env.CACHE_NUMBER }}-${{ | |
hashFiles('conda_envs/edgar_connect.yaml') }} | |
- name: Cache multiple paths | |
uses: actions/cache@v3 | |
env: | |
# Increase this value to reset cache if requirements.txt has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: | | |
~/.cache/pip | |
$RUNNER_TOOL_CACHE/Python/* | |
~\AppData\Local\pip\Cache | |
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ | |
hashFiles('requirements.txt') }} | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniforge-variant: Miniforge3 | |
miniforge-version: latest | |
mamba-version: "*" | |
activate-environment: edgar_connect | |
channel-priority: strict | |
environment-file: conda_envs/environment.yml | |
python-version: ${{ matrix.python-version }} | |
use-mamba: true | |
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267 | |
- name: Install current branch | |
run: | | |
conda activate edgar_connect | |
pip install -e . | |
python --version | |
- name: Run tests | |
run: | | |
python -m pytest -vv --cov=edgar_connect --cov-report=xml --no-cov-on-fail --cov-report term $TEST_SUBSET | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # use token for more robust uploads | |
env_vars: TEST_SUBSET | |
name: ${{ matrix.os }} | |
fail_ci_if_error: false | |
verbose: true |