From 9db557c6a5f5ee91233da3e376774c03abaac000 Mon Sep 17 00:00:00 2001 From: John Boehr Date: Sat, 28 Sep 2024 12:26:34 -0700 Subject: [PATCH] Update packages, test on PHP 8.4 --- .github/workflows/ci.yml | 23 +++++--- composer.json | 5 +- composer.lock | 110 +++++++++++++++++++-------------------- flake.lock | 50 ++++++++++++------ flake.nix | 42 ++++++++++----- 5 files changed, 137 insertions(+), 93 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ee4068..48060ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,10 +23,7 @@ jobs: - "8.1" - "8.2" - "8.3" -# include: -# - php-version: "8.4" -# allow-failure: "true" -# continue-on-error: ${{ matrix.allow-failure == 'true' }} + - "8.4" steps: - uses: actions/checkout@v4 @@ -68,10 +65,7 @@ jobs: - "8.1" - "8.2" - "8.3" -# include: -# - php-version: "8.4" -# allow-failure: "true" -# continue-on-error: ${{ matrix.allow-failure == 'true' }} + - "8.4" steps: - uses: actions/checkout@v4 @@ -114,3 +108,16 @@ jobs: # uses: coverallsapp/github-action@v2 # with: # parallel-finished: true + + nix: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: cachix/install-nix-action@v27 + with: + nix_path: nixpkgs=channel:nixos-24.05 + + # - run: nix build -L + + - run: nix flake check -L diff --git a/composer.json b/composer.json index b9ed0b0..62573c5 100644 --- a/composer.json +++ b/composer.json @@ -31,5 +31,8 @@ "require-dev": { "phpunit/phpunit": ">=7.4" }, - "type" : "library" + "type" : "library", + "_comment": [ + "Think not that I am come to send peace on earth: I came not to send peace, but a sword. Matthew 10:34" + ] } diff --git a/composer.lock b/composer.lock index 630c770..c5d96da 100644 --- a/composer.lock +++ b/composer.lock @@ -69,16 +69,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.0.2", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + "reference": "23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb", + "reference": "23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb", "shasum": "" }, "require": { @@ -89,7 +89,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -121,9 +121,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.2.0" }, - "time": "2024-03-05T20:51:40+00:00" + "time": "2024-09-15T16:40:33+00:00" }, { "name": "phar-io/manifest", @@ -245,32 +245,32 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.14", + "version": "10.1.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b" + "reference": "7e308268858ed6baedc8704a304727d20bc07c77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", - "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=8.1", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-text-template": "^3.0", - "sebastian/code-unit-reverse-lookup": "^3.0", - "sebastian/complexity": "^3.0", - "sebastian/environment": "^6.0", - "sebastian/lines-of-code": "^2.0", - "sebastian/version": "^4.0", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-text-template": "^3.0.1", + "sebastian/code-unit-reverse-lookup": "^3.0.0", + "sebastian/complexity": "^3.2.0", + "sebastian/environment": "^6.1.0", + "sebastian/lines-of-code": "^2.0.2", + "sebastian/version": "^4.0.1", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { "phpunit/phpunit": "^10.1" @@ -282,7 +282,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.1-dev" + "dev-main": "10.1.x-dev" } }, "autoload": { @@ -311,7 +311,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.14" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16" }, "funding": [ { @@ -319,7 +319,7 @@ "type": "github" } ], - "time": "2024-03-12T15:33:41+00:00" + "time": "2024-08-22T04:31:57+00:00" }, { "name": "phpunit/php-file-iterator", @@ -566,16 +566,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.22", + "version": "10.5.35", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "8afb89b399b17c2ce2618015bdc9f81a117c5ee1" + "reference": "7ac8b4e63f456046dcb4c9787da9382831a1874b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8afb89b399b17c2ce2618015bdc9f81a117c5ee1", - "reference": "8afb89b399b17c2ce2618015bdc9f81a117c5ee1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7ac8b4e63f456046dcb4c9787da9382831a1874b", + "reference": "7ac8b4e63f456046dcb4c9787da9382831a1874b", "shasum": "" }, "require": { @@ -585,26 +585,26 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=8.1", - "phpunit/php-code-coverage": "^10.1.5", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-invoker": "^4.0", - "phpunit/php-text-template": "^3.0", - "phpunit/php-timer": "^6.0", - "sebastian/cli-parser": "^2.0", - "sebastian/code-unit": "^2.0", - "sebastian/comparator": "^5.0", - "sebastian/diff": "^5.0", - "sebastian/environment": "^6.0", - "sebastian/exporter": "^5.1", - "sebastian/global-state": "^6.0.1", - "sebastian/object-enumerator": "^5.0", - "sebastian/recursion-context": "^5.0", - "sebastian/type": "^4.0", - "sebastian/version": "^4.0" + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-invoker": "^4.0.0", + "phpunit/php-text-template": "^3.0.1", + "phpunit/php-timer": "^6.0.0", + "sebastian/cli-parser": "^2.0.1", + "sebastian/code-unit": "^2.0.0", + "sebastian/comparator": "^5.0.2", + "sebastian/diff": "^5.1.1", + "sebastian/environment": "^6.1.0", + "sebastian/exporter": "^5.1.2", + "sebastian/global-state": "^6.0.2", + "sebastian/object-enumerator": "^5.0.0", + "sebastian/recursion-context": "^5.0.0", + "sebastian/type": "^4.0.0", + "sebastian/version": "^4.0.1" }, "suggest": { "ext-soap": "To be able to generate mocks based on WSDL files" @@ -647,7 +647,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.22" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.35" }, "funding": [ { @@ -663,7 +663,7 @@ "type": "tidelift" } ], - "time": "2024-06-19T05:29:34+00:00" + "time": "2024-09-19T10:52:21+00:00" }, { "name": "sebastian/cli-parser", @@ -835,16 +835,16 @@ }, { "name": "sebastian/comparator", - "version": "5.0.1", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372" + "reference": "2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53", + "reference": "2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53", "shasum": "" }, "require": { @@ -855,7 +855,7 @@ "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.3" + "phpunit/phpunit": "^10.4" }, "type": "library", "extra": { @@ -900,7 +900,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.2" }, "funding": [ { @@ -908,7 +908,7 @@ "type": "github" } ], - "time": "2023-08-14T13:18:12+00:00" + "time": "2024-08-12T06:03:08+00:00" }, { "name": "sebastian/complexity", diff --git a/flake.lock b/flake.lock index fa6faa0..d7ba80e 100644 --- a/flake.lock +++ b/flake.lock @@ -18,14 +18,16 @@ }, "flake-utils": { "inputs": { - "systems": "systems" + "systems": [ + "systems" + ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -77,11 +79,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1718437845, - "narHash": "sha256-ZT7Oc1g4I4pHVGGjQFnewFVDRLH5cIZhEzODLz9YXeY=", + "lastModified": 1727397532, + "narHash": "sha256-pojbL/qteElw/nIXlN8kmHn/w6PQbEHr7Iz+WOXs0EM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "752c634c09ceb50c45e751f8791cb45cb3d46c9e", + "rev": "f65141456289e81ea0d5a05af8898333cab5c53d", "type": "github" }, "original": { @@ -93,16 +95,32 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1710695816, - "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "lastModified": 1720386169, + "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "614b4613980a522ba49f0d194531beddbb7220d3", + "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.11", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1727348695, + "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -117,11 +135,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1718825512, - "narHash": "sha256-nz7idS/SZWcTUGJ+lOFL+eJayrL/LpkUiy7+FxThAh4=", + "lastModified": 1727514110, + "narHash": "sha256-0YRcOxJG12VGDFH8iS8pJ0aYQQUAgo/r3ZAL+cSh9nk=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "97c0dc865fe9a062c5970f4bcf55bb9e6028bcf5", + "rev": "85f7a7177c678de68224af3402ab8ee1bcee25c8", "type": "github" }, "original": { @@ -135,7 +153,9 @@ "flake-utils": "flake-utils", "gitignore": "gitignore", "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks" + "nixpkgs-unstable": "nixpkgs-unstable", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems" } }, "systems": { diff --git a/flake.nix b/flake.nix index 1adb72d..af9deb7 100644 --- a/flake.nix +++ b/flake.nix @@ -3,8 +3,11 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + systems.url = "github:nix-systems/default"; flake-utils = { url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; }; pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; @@ -19,6 +22,8 @@ outputs = { self, nixpkgs, + nixpkgs-unstable, + systems, flake-utils, pre-commit-hooks, gitignore, @@ -34,7 +39,7 @@ enabled ++ [all.pcov]; }; pkgs = nixpkgs.legacyPackages.${system}; - php = buildEnv pkgs.php81; + pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; src = gitignore.lib.gitignoreSource ./.; pre-commit-check = pre-commit-hooks.lib.${system}.run { @@ -48,24 +53,33 @@ shellcheck.enable = true; }; }; + + makeShell = {php}: + pkgs.mkShell { + buildInputs = with pkgs; [ + actionlint + alejandra + mdl + php + php.packages.composer + pre-commit + ]; + shellHook = '' + ${pre-commit-check.shellHook} + export PATH="$PWD/vendor/bin:$PATH" + ''; + }; in rec { checks = { inherit pre-commit-check; }; - devShells.default = pkgs.mkShell { - buildInputs = with pkgs; [ - actionlint - alejandra - mdl - php - php.packages.composer - pre-commit - ]; - shellHook = '' - ${pre-commit-check.shellHook} - export PATH="$PWD/vendor/bin:$PATH" - ''; + devShells = rec { + php81 = makeShell {php = pkgs.php81;}; + php82 = makeShell {php = pkgs.php82;}; + php83 = makeShell {php = pkgs.php83;}; + php84 = makeShell {php = pkgs-unstable.php84;}; + default = php81; }; formatter = pkgs.alejandra;