Bump codecov/codecov-action from 5.3.1 to 5.4.0 #233
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: test | |
on: [push] | |
jobs: | |
test-job: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11"] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache conda | |
uses: actions/cache@v4 | |
env: | |
# Increase this value to reset cache if environment.yml has not changed | |
CACHE_NUMBER: 1 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-py${{matrix.python-version}}-conda-${{ env.CACHE_NUMBER }}-${{ | |
hashFiles('environment.yml') }} | |
- name: Cache multiple paths | |
uses: actions/cache@v4 | |
env: | |
# Increase this value to reset cache | |
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@v3 | |
with: | |
miniforge-version: latest | |
mamba-version: "*" | |
activate-environment: ptfenv | |
channel-priority: strict | |
environment-file: environment.yml | |
python-version: ${{matrix.python-version}} | |
use-mamba: true | |
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
- name: Install pytensor-federated | |
run: | | |
conda activate ptfenv | |
pip install -e . | |
- name: Run tests | |
run: | | |
pytest -v --cov=./pytensor_federated --cov-report xml --cov-report term-missing . | |
- name: Upload coverage | |
uses: codecov/[email protected] | |
with: | |
file: ./coverage.xml | |
- name: Test Wheel install and import | |
run: | | |
python setup.py bdist_wheel | |
cd dist | |
pip install pytensor_federated*.whl | |
python -c "import pytensor_federated; print(pytensor_federated.__version__)" | |
- name: Test Wheel with twine | |
run: | | |
pip install twine | |
twine check dist/* |