Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/tests_no_warnings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Tests

on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]

jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10"]

name: Build and test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
# Required when using an activated conda environment in steps
# See https://github.com/conda-incubator/setup-miniconda#IMPORTANT
shell: bash -l {0}

steps:
- uses: actions/checkout@master

- name: Set up conda environment
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: clm
environment-file: environment.yml

- name: Install pip
run: conda install pip

- name: Install torch (CPU-only)
run: pip install torch --index-url https://download.pytorch.org/whl/cpu

- name: Install package
run: pip install -e .

- name: Conda info
run: |
conda info
conda list

- name: Pre-commit checks
run: |
pre-commit run --all-files

- name: Pytest with coverage (warnings as errors)
run: coverage run --source=src/clm -m pytest
env:
PYTHONWARNINGS: error

- name: Upload coverage to Coveralls
if: matrix.os == 'ubuntu-latest'
run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}