Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 52 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# CHANGELOG

## 1.0.0 - 2022-08-28
## [Unreleased]
### Changed
- Development stuff

## [1.0.0] - 2022-08-28
### Added
- Dockerized php dev env

### Changed
- Update phpunit to last version
- Typing signatures

## 1.0.0-rc - 2015-12-31
## [1.0.0-rc] - 2015-12-31
### Added
- All classes.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# Bit Mask

Simple implementation for basic bitwise operations.
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
```
2 changes: 2 additions & 0 deletions dev.env
Original file line number Diff line number Diff line change
@@ -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
Loading