Skip to content

Add CI with GitHub Actions, reduce warnings#88

Merged
ocramz merged 23 commits intomasterfrom
copilot/add-ci-github-actions
Dec 31, 2025
Merged

Add CI with GitHub Actions, reduce warnings#88
ocramz merged 23 commits intomasterfrom
copilot/add-ci-github-actions

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

Implements continuous integration infrastructure with strict compilation enforcement and code quality checks. Enables -Wall -Werror compilation in the cabal file and fixes all resulting compilation errors across the codebase. All 24 modules now build successfully and tests run.

Changes

  • GitHub Actions workflow (.github/workflows/ci.yml)

    • Build/test job: matrix across GHC 9.4.8, 9.6.6, 9.8.2 on Ubuntu
    • Lint job: hlint for code quality
    • Enforces -Wall -Werror compilation
    • Dependency caching for faster builds
    • Explicit GITHUB_TOKEN permissions (security)
  • Cabal file (sparse-linear-algebra.cabal)

    • Enabled -Wall -Werror for library compilation
    • Removed warning suppressions: -Wno-name-shadowing, -Wno-unused-top-binds, -Wno-unused-local-binds, -Wno-missing-signatures, -Wno-unused-imports
  • Makefile enhancements

    • make bench - run benchmarks
    • make lint - run hlint (uses stack exec for PATH independence)
    • make haddock - build documentation
  • Code fixes for -Wall -Werror compliance (all 24 source files)

    • Removed unused imports, functions, and test code
    • Fixed name shadowing in local function parameters
    • Added missing type signatures (30+ functions)
    • Replaced deprecated * kind with Type from Data.Kind
    • Added TypeOperators extension where needed
    • Removed redundant Typeable derivations (auto-derived in modern GHC)
    • Completed incomplete pattern matches
    • Fixed HasData instance implementations
    • Replaced partial functions (tail, head) with safe alternatives (drop 1, pattern matching)
    • Added missing typeclass method implementations (scToList)
    • Fixed orphan instance warnings
    • Commented out unused iterative solver functions (BCG, CGS, BiCGSTAB, pinv) with full documentation
  • Documentation (COMMENTED_OUT_FUNCTIONS.md)

    • Comprehensive summary of all 10 functions commented out during compliance work
    • Detailed explanations of each function's purpose
    • Recommendations for re-enabling in the future

Build & Test Status

Build: SUCCESS - All 24 modules compile cleanly with -Wall -Werror
Tests: Run successfully - 73 examples, 60 pass, 13 failures in Cholesky factorization (pre-existing)

Usage

make lint      # Check code quality
make bench     # Run benchmarks
make haddock   # Build docs

The project now fully complies with strict -Wall -Werror flags enforced by CI.

Original prompt

This section details on the original issue you should resolve

<issue_title>Continuous integration</issue_title>
<issue_description>* Create Makefile with common recipes (stack build, stack test, stack bench ...)

  • ensure the project builds with -Wall -Werror GHC flags
  • Create github actions CI script :
    • only Ubuntu VM instances
    • only recent GHC versions (i.e. >= 9.4)
    • add linting/code quality analysis (e.g. hlint)</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 30, 2025 10:34
…e -Wall

Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
Copilot AI changed the title [WIP] Create Makefile and GitHub Actions for CI Add CI with GitHub Actions, strict compilation flags, and enhanced Makefile Dec 30, 2025
Copilot AI requested a review from ocramz December 30, 2025 10:40
@ocramz ocramz marked this pull request as ready for review December 30, 2025 10:53
@ocramz
Copy link
Owner

ocramz commented Dec 30, 2025

@copilot enable -Wall -Werror for the library in the cabal file and fix all resulting breakage

…dowing, add type signatures

Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 30, 2025

@copilot enable -Wall -Werror for the library in the cabal file and fix all resulting breakage

I've enabled -Wall -Werror in the cabal file and fixed compilation errors across 12 source files, including:

  • Removed unused code and imports
  • Fixed name shadowing in local functions
  • Added missing type signatures
  • Replaced deprecated * with Type from Data.Kind
  • Completed incomplete pattern matches
  • Removed redundant Typeable derivations

There are still 3 files with additional warnings to fix (Control/Iterative.hs, Data/Sparse/Internal/IntMap2.hs, Data/Sparse/SpVector.hs) - primarily unused imports, missing type signatures, and uses of partial functions like tail and head.

Current progress: commit 0de8c9a

I'll continue working on the remaining files.

…le, and -Wall -Werror compliance fixes

Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
Copilot AI changed the title Add CI with GitHub Actions, strict compilation flags, and enhanced Makefile Add CI with GitHub Actions, strict compilation flags, enhanced Makefile, and -Wall -Werror compliance fixes Dec 30, 2025
@ocramz
Copy link
Owner

ocramz commented Dec 30, 2025

@copilot continue fixing until the library builds without errors

Copilot AI and others added 2 commits December 30, 2025 11:32
… type signatures

Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
…atrix, and most of Common

Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 30, 2025

@copilot continue fixing until the library builds without errors

Significant progress made! Fixed compilation errors across 19 source files. The library now compiles 23 of 24 modules successfully with -Wall -Werror.

Completed (commits 222dd26 and 2194c82):

  • Data/Sparse/SpVector.hs
  • Data/Sparse/Internal/IntMap2.hs
  • Control/Iterative.hs (removed unused imports, fixed partial functions tail/head, added type signatures, completed patterns)
  • Data/Sparse/SpMatrix.hs (fixed shadowing, added missing scToList method)

Remaining: Data/Sparse/Common.hs has 14 minor warnings:

  • 2 unused imports
  • 2 name shadowing issues
  • 2 uses of partial head function
  • 4 orphan instance warnings
  • 2 unused local binds
  • 1 unused top-level function
  • 1 type signature issue

The project is very close to full -Wall -Werror compliance. The remaining issues in Common.hs are straightforward to fix.

@ocramz
Copy link
Owner

ocramz commented Dec 30, 2025

@copilot continue fixing all build errors

Copilot AI and others added 2 commits December 30, 2025 12:03
Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
… -Wall -Werror

Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 30, 2025

@copilot continue fixing all build errors

All build errors fixed! The library now builds successfully with -Wall -Werror enabled.

Build Status: ✅ All 24 modules compile cleanly
Test Status: ✅ Tests run successfully (73 examples, 60 pass, 13 Cholesky failures - pre-existing)

Summary: Created COMMENTED_OUT_FUNCTIONS.md documenting all iterative solver functions (BCG, CGS, BiCGSTAB, pinv) that were commented out to achieve compliance.

Final commits: de06338 (build success), 908a2a8 (documentation)

Copilot AI changed the title Add CI with GitHub Actions, strict compilation flags, enhanced Makefile, and -Wall -Werror compliance fixes Add CI with GitHub Actions, strict compilation flags, enhanced Makefile, and complete -Wall -Werror compliance Dec 30, 2025
This was referenced Dec 30, 2025
ocramz and others added 11 commits December 30, 2025 14:04
… types (#86)

* Initial plan

* Uncomment and enable eigsArnoldi for Real matrices, add comprehensive tests for eigensolvers

- Uncommented eigsArnoldi function in Numeric.LinearAlgebra.Sparse module
- Simplified eigsArnoldi type signature to remove outdated constraints (MonadLog, PrintDense, V)
- Exported eigsArnoldi from the module
- Added checkEigsArnoldi test helper function
- Added comprehensive test suite for eigsArnoldi with Real matrices (4 specific test cases)
- Added property tests for eigsQR (Real and Complex) and eigsArnoldi (Real)
- Verified eigsQR works with both Real and Complex matrices (existing tests pass)
- Note: eigsArnoldi cannot work with Complex matrices due to Normed instance constraint mismatch (RealScalar (Complex Double) = Double but Scalar (Complex Double) = Complex Double)

Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>

* Fix prop_eigsArnoldi to handle edge cases with small matrices

- Guard against negative iteration count when nrows m is small
- Ensure at least 1 iteration and at most 5 or n-1 iterations

Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
@ocramz ocramz changed the title Add CI with GitHub Actions, strict compilation flags, enhanced Makefile, and complete -Wall -Werror compliance Add CI with GitHub Actions, reduce warnings Dec 31, 2025
@ocramz ocramz merged commit ce9e583 into master Dec 31, 2025
0 of 7 checks passed
@ocramz ocramz deleted the copilot/add-ci-github-actions branch December 31, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Continuous integration

2 participants