Skip to content

Commit

Permalink
Merge 08408f1 into 25e8855
Browse files Browse the repository at this point in the history
  • Loading branch information
jbboehr committed Dec 11, 2019
2 parents 25e8855 + 08408f1 commit a736cf4
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ matrix:
fast_finish: true
allow_failures:
- php: 'master'
- language: nix
env:
- NIX_CHANNEL=unstable
- NIX_PHP_ATTR=php74
- language: nix
env:
- NIX_CHANNEL=unstable
Expand All @@ -15,6 +19,8 @@ matrix:
php: '7.2'
- language: php
php: '7.3'
- language: php
php: '7.4'
- language: php
php: 'master'
- language: nix
Expand All @@ -33,6 +39,10 @@ matrix:
env:
- NIX_CHANNEL=19.03
- NIX_PHP_ATTR=php73
- language: nix
env:
- NIX_CHANNEL=unstable
- NIX_PHP_ATTR=php74
- language: nix
env:
- NIX_CHANNEL=unstable
Expand Down
77 changes: 77 additions & 0 deletions ci.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
let
generateTestsForPlatform = { pkgs, php, buildPecl, src }:
pkgs.recurseIntoAttrs {
oath = pkgs.callPackage ./default.nix {
inherit php buildPecl ;
phpOathSrc = src;
};
};
in
builtins.mapAttrs (k: _v:
let
path = builtins.fetchTarball {
url = https://github.com/NixOS/nixpkgs/archive/release-19.09.tar.gz;
name = "nixpkgs-19.09";
};
pkgs = import (path) { system = k; };

src = builtins.filterSource
(path: type: baseNameOf path != ".idea" && baseNameOf path != ".git" && baseNameOf path != "ci.nix" && baseNameOf path != ".ci")
./.;
in
pkgs.recurseIntoAttrs {
php71 = let
path = builtins.fetchTarball {
url = https://github.com/NixOS/nixpkgs/archive/release-19.03.tar.gz;
name = "nixpkgs-19.03";
};
pkgs = import (path) { system = k; };
php = pkgs.php71;
in generateTestsForPlatform {
inherit pkgs php src;
buildPecl = pkgs.callPackage "${path}/pkgs/build-support/build-pecl.nix" { inherit php; };
};

php72 = let
php = pkgs.php72;
in generateTestsForPlatform {
inherit pkgs php src;
buildPecl = pkgs.callPackage "${path}/pkgs/build-support/build-pecl.nix" { inherit php; };
};

php73 = let
php = pkgs.php73;
in generateTestsForPlatform {
inherit pkgs php src;
buildPecl = pkgs.callPackage "${path}/pkgs/build-support/build-pecl.nix" { inherit php; };
};

php74 = let
path = builtins.fetchTarball {
url = https://github.com/NixOS/nixpkgs/archive/master.tar.gz;
name = "nixpkgs-unstable";
};
pkgs = import (path) { system = k; };
php = pkgs.php74;
in generateTestsForPlatform {
inherit pkgs php src;
buildPecl = pkgs.callPackage "${path}/pkgs/build-support/build-pecl.nix" { inherit php; };
};

php = let
path = builtins.fetchTarball {
url = https://github.com/NixOS/nixpkgs/archive/master.tar.gz;
name = "nixpkgs-unstable";
};
pkgs = import (path) { system = k; };
php = pkgs.php;
in generateTestsForPlatform {
inherit pkgs php src;
buildPecl = pkgs.callPackage "${path}/pkgs/build-support/build-pecl.nix" { inherit php; };
};
}
) {
x86_64-linux = {};
# Uncomment to test build on macOS too
# x86_64-darwin = {};
}
5 changes: 4 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
pkgs ? import <nixpkgs> {},
php ? pkgs.php,
buildPecl ? pkgs.callPackage <nixpkgs/pkgs/build-support/build-pecl.nix> {
inherit php;
},

phpOathVersion ? null,
phpOathSrc ? ./.,
phpOathSha256 ? null
}:

pkgs.callPackage ./derivation.nix {
inherit php phpOathVersion phpOathSrc phpOathSha256;
inherit php buildPecl phpOathVersion phpOathSrc phpOathSha256;
}

9 changes: 5 additions & 4 deletions derivation.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{ php, stdenv, autoreconfHook, fetchurl, oathToolkit, pkgconfig,
buildPecl ? import <nixpkgs/pkgs/build-support/build-pecl.nix> {
# re2c is required for nixpkgs master, must not be specified for <= 19.03
inherit php stdenv autoreconfHook fetchurl;
},
phpOathVersion ? null, phpOathSrc ? null, phpOathSha256 ? null }:

let
orDefault = x: y: (if (!isNull x) then x else y);
buildPecl = import <nixpkgs/pkgs/build-support/build-pecl.nix> {
inherit php stdenv autoreconfHook fetchurl;
};
in

buildPecl rec {
Expand All @@ -23,6 +24,6 @@ buildPecl rec {

doCheck = true;
checkTarget = "test";
checkFlagsArray = ["REPORT_EXIT_STATUS=1" "NO_INTERACTION=1" "TEST_PHP_DETAILED=1"];
checkFlags = ["REPORT_EXIT_STATUS=1" "NO_INTERACTION=1"];
}

0 comments on commit a736cf4

Please sign in to comment.