Fixed and simplified the CLI for the evaluation subcommand #297
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: Pre-merge checks | |
on: | |
pull_request: | |
branches: [ "main" ] | |
push: | |
branches: [ "main" ] | |
jobs: | |
pre-commit: | |
name: Pre-commit checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- uses: pre-commit/[email protected] | |
with: | |
extra_args: ruff --all-files | |
test-docs: | |
name: Run build docs and tune doctests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
cache-dependency-path: pyproject.toml | |
- name: Install pandoc | |
shell: bash | |
run: | | |
sudo apt update | |
sudo apt install -y pandoc | |
- name: Install python dependencies | |
run: | | |
pip install -e ".[docs,test,notebooks]" | |
- name: Ensure no warnings | |
run: | | |
python -m sphinx -W docs/source docs/build | |
- name: Run doc-tests | |
run: | | |
cd docs && make doctest | |
- name: Test the tutorial notebooks | |
run: | | |
python -m ipykernel install --user --name tuned-lens | |
python -m pytest --nbmake docs/source/tutorials/*.ipynb \ | |
--nbmake-kernel=tuned-lens | |
python-build-and-test: | |
name: Install and run tests to ensure dependencies are specific enough. | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{matrix.python-version}} | |
cache: 'pip' | |
cache-dependency-path: pyproject.toml | |
- name: Install dependencies | |
run: | | |
pip install -e .[test] | |
- name: Run basic unit tests | |
run: | | |
pytest | |
docker-build-and-test: | |
name: Build Docker image and run unit tests within it. Keeping track of coverage | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver: docker | |
- name: Build Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
target: test | |
tags: unit_test_img:latest | |
- name: Run unit tests | |
run: | | |
docker run \ | |
-v $PWD:/workspace \ | |
--pull=never \ | |
--rm unit_test_img:latest \ | |
pytest --cov=./ --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
directory: ./coverage/reports/ | |
env_vars: OS,PYTHON | |
fail_ci_if_error: true | |
files: ./coverage.xml | |
verbose: true |