From 48fd4f3e02eadab2189003a729f2bf4aefd64381 Mon Sep 17 00:00:00 2001 From: Vineet Bansal Date: Tue, 17 Dec 2024 09:51:31 -0500 Subject: [PATCH] trying to get rid of all warnings --- .github/workflows/tests_no_warnings.yml | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/tests_no_warnings.yml diff --git a/.github/workflows/tests_no_warnings.yml b/.github/workflows/tests_no_warnings.yml new file mode 100644 index 00000000..97701003 --- /dev/null +++ b/.github/workflows/tests_no_warnings.yml @@ -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 }}