Skip to content

Commit

Permalink
Add test matrix for Python 3.(6|7|8) & MKL/OpenBLAS
Browse files Browse the repository at this point in the history
  • Loading branch information
RaitoBezarius authored May 3, 2020
1 parent 56eb735 commit c0c2745
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-and-test:
firaga-test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
blasProvider: [ "openblasCompat", "mkl" ]
pythonVersion: [ "python36", "python37", "python38" ]

env:
PYTHON_PACKAGE_NAME: ${{ matrix.pythonVersion }}
BLAS_PROVIDER: ${{ matrix.blasProvider }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -32,9 +39,15 @@ jobs:
name: mangaki
# Signing key secret retrieved after creating binary cache on https://cachix.org
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'

- name: Run tests
run: nix-shell shell.nix --command "py.test -n 2 --cov-report=xml --cov=zero"
run: |
nix-shell default.nix \
-A shell \
--argstr blasProvider "$BLAS_PROVIDER" \
--argstr pythonPackageName "$PYTHON_PACKAGE_NAME" \
--command "py.test --cov-report=xml --cov=zero"
- name: Report coverage results to CodeCov
run: bash <(curl -s https://codecov.io/bash)

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

Mangaki's recommendation algorithms.

It is tested on Python 3.6, 3.7 and 3.8 over OpenBLAS LP64 & MKL.

## Usage

Most models have the following routines:
Expand Down
26 changes: 25 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
{ pkgs ? import <nixpkgs> {}, python ? pkgs.python3, useMKL ? true }:
let ourNixpkgs =
builtins.fetchGit {
# Descriptive name to make the store path easier to identify
name = "nixos-unstable-2020-05-02";
url = "https://github.com/nixos/nixpkgs-channels/";
# Commit hash for nixos-unstable as of 2020-05-02
# `git ls-remote https://github.com/nixos/nixpkgs-channels nixos-unstable`
ref = "refs/heads/nixos-unstable";
rev = "fce7562cf46727fdaf801b232116bc9ce0512049";
};
in
{ blasProvider ? "openblasCompat"
, pkgs ? import ourNixpkgs {
config.allowUnfree = blasProvider == "mkl";
overlays = [
(self: super: {
lapack = super.lapack.override {
lapackProvider = super.${blasProvider};
};
blas = super.blas.override {
blasProvider = super.${blasProvider};
};
})]; }
, pythonPackageName ? "python3"
, python ? pkgs.${pythonPackageName}}:

rec {
pythonDependencies = (python.withPackages
Expand Down

0 comments on commit c0c2745

Please sign in to comment.