From dc07d61cf99182294a44f87bfe9761fa5bc44550 Mon Sep 17 00:00:00 2001 From: samizdam Date: Thu, 10 Sep 2026 17:53:32 +0300 Subject: [PATCH 1/2] Up ci file --- .github/workflows/main.yml | 76 ++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 12fe920..6f3ad61 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,33 +1,61 @@ -# This is a basic workflow to help you get started with Actions - name: CI -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "master" branch - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: +on: push -# 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: - # The type of runner that the job will run on + php-tests: + continue-on-error: ${{ matrix.experimental }} + strategy: + matrix: + experimental: [false] + php: + - 7.4 + - 8.0 + - 8.1 + - 8.2 + - 8.3 + - 8.4 + - 8.5 + include: + - php: 8.6 + prefer: stable + experimental: true + prefer: + - lowest + - stable + fail-fast: false + + name: Test on PHP ${{ matrix.php }} with ${{ matrix.prefer }} composer prefer option runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - name: Check PHP Version + run: php -v + + - name: Xdebug Action + uses: MilesChou/docker-xdebug@master - # Runs a set of commands using the runners shell - - name: Build project - run: make install + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.prefer }}- + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ matrix.prefer }}- + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer update --prefer-${{ matrix.prefer }} --prefer-dist --no-progress - - name: Test - run: make test + - name: Run tests + env: + XDEBUG_MODE: coverage + run: vendor/bin/phpunit \ No newline at end of file From 0150332dc3e49b71ccf874710cb4791d2b494885 Mon Sep 17 00:00:00 2001 From: samizdam Date: Thu, 10 Sep 2026 18:17:48 +0300 Subject: [PATCH 2/2] Actualize development stuff, up readme and test many php versions --- CHANGELOG.md | 8 ++++++-- Dockerfile | 4 +++- Makefile | 9 ++++----- README.md | 21 ++++++++++++++++++++- dev.env | 2 ++ 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 500fd95..f099fb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # CHANGELOG -## 1.0.0 - 2022-08-28 +## [Unreleased] +### Changed +- Development stuff + +## [1.0.0] - 2022-08-28 ### Added - Dockerized php dev env @@ -8,6 +12,6 @@ - Update phpunit to last version - Typing signatures -## 1.0.0-rc - 2015-12-31 +## [1.0.0-rc] - 2015-12-31 ### Added - All classes. diff --git a/Dockerfile b/Dockerfile index 6ca3c83..344ecd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM php:8.1-cli +ARG PHP_VERSION=8.5 + +FROM php:${PHP_VERSION}-cli # Composer requirements begin RUN apt-get update \ diff --git a/Makefile b/Makefile index 07c98e7..c7cb3ef 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,12 @@ -PATH := $(shell pwd)/bin:$(PATH) -$(shell cp -n dev.env .env) -include .env +ENV_FILE ?= .env +-include $(ENV_FILE) install: build composer install cp -n phpunit.xml.dist phpunit.xml build: - docker build -t $(PHP_DEV_IMAGE):$(REVISION) . + docker build --build-arg PHP_VERSION=$(PHP_VERSION) -t $(PHP_DEV_IMAGE):$(REVISION) --no-cache . test: - php vendor/bin/phpunit + vendor/bin/phpunit diff --git a/README.md b/README.md index caa28a3..9668ff6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ # Bit Mask -Simple implementation for basic bitwise operations. \ No newline at end of file +Simple implementation for basic bitwise operations. + +## Usage + +``` +composer require free-elephants/bitmask +``` + + + +## Development installation + +For dockerized env add path first: +``` +PATH=$(pwd)/bin:$PATH +``` + +``` +make install test +``` \ No newline at end of file diff --git a/dev.env b/dev.env index 3d82f3a..f61d659 100644 --- a/dev.env +++ b/dev.env @@ -1,3 +1,5 @@ PHP_DEV_IMAGE=free-elephants/bit-mask # default tag for images, replaced with CI environment value: branch or tag name REVISION=master + +PHP_VERSION=8.5