Skip to content
Open
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
45 changes: 15 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Call php-cs-fixer Dagger Function
uses: dagger/dagger-for-github@v7
with:
php-version: '8.3'

- name: Install dependencies
uses: ramsey/composer-install@v3

- name: PHP CS Fixer
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --ansi
version: "latest"
verb: call
args: php-cs-fixer --source=.

psalm:
runs-on: ubuntu-latest
Expand All @@ -32,17 +28,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Psalm
uses: docker://ghcr.io/psalm/psalm-github-actions
with:
show_info: true
security_analysis: true
report_file: results.sarif

- name: Upload Analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
- name: Call Psalm Dagger Function
uses: dagger/dagger-for-github@v7
with:
sarif_file: results.sarif
version: "latest"
verb: call
args: psalm --source=.

phpunit:
runs-on: ubuntu-latest
Expand All @@ -55,15 +46,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Call Test Dagger Function
uses: dagger/dagger-for-github@v7
with:
php-version: ${{ matrix.php-versions }}

- name: Install dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies-versions }}

- name: Run tests
run: vendor/bin/phpunit --coverage-text
version: "latest"
verb: call
args: test --source=. --php-version=${{ matrix.php-versions }} --dependency-version=${{ matrix.dependencies-versions }}
28 changes: 7 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
.PHONY: build cli test test_all_targets psalm

build:
docker build -t yohang/finite .
dagger call build

cli:
docker run -it --rm -v${PWD}:/app -w/app yohang/finite ash
dagger call cli

test:
docker run -it --rm -v${PWD}:/app -w/app yohang/finite php ./vendor/bin/phpunit --coverage-text
dagger call test

test_all_targets:
docker build -t yohang/finite:php-8.1 --build-arg PHP_VERSION=8.1 .
docker build -t yohang/finite:php-8.1-lowest --build-arg PHP_VERSION=8.1 --build-arg DEPENDENCIES=lowest .
docker build -t yohang/finite:php-8.2 --build-arg PHP_VERSION=8.2 .
docker build -t yohang/finite:php-8.2-lowest --build-arg PHP_VERSION=8.2 --build-arg DEPENDENCIES=lowest .
docker build -t yohang/finite:php-8.3 --build-arg PHP_VERSION=8.3 .
docker build -t yohang/finite:php-8.3-lowest --build-arg PHP_VERSION=8.3 --build-arg DEPENDENCIES=lowest .
docker build -t yohang/finite:php-8.4 --build-arg PHP_VERSION=8.4 .
docker build -t yohang/finite:php-8.4-lowest --build-arg PHP_VERSION=8.4 --build-arg DEPENDENCIES=lowest .
docker run -it --rm yohang/finite:php-8.1 php ./vendor/bin/phpunit --coverage-text
docker run -it --rm yohang/finite:php-8.1-lowest php ./vendor/bin/phpunit --coverage-text
docker run -it --rm yohang/finite:php-8.2 php ./vendor/bin/phpunit --coverage-text
docker run -it --rm yohang/finite:php-8.2-lowest php ./vendor/bin/phpunit --coverage-text
docker run -it --rm yohang/finite:php-8.3 php ./vendor/bin/phpunit --coverage-text
docker run -it --rm yohang/finite:php-8.3-lowest php ./vendor/bin/phpunit --coverage-text
docker run -it --rm yohang/finite:php-8.4 php ./vendor/bin/phpunit --coverage-text
docker run -it --rm yohang/finite:php-8.4-lowest php ./vendor/bin/phpunit --coverage-text
dagger call test-all

psalm:
docker build -t yohang/finite:php-8.4 --build-arg PHP_VERSION=8.4 .
docker run -it --rm yohang/finite:php-8.4 php ./vendor/bin/psalm --show-info=true --no-diff
dagger call psalm
8 changes: 8 additions & 0 deletions dagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Finite",
"engineVersion": "v0.15.4",
"sdk": {
"source": "php"
},
"source": "dagger"
}
2 changes: 2 additions & 0 deletions dagger/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/sdk/** linguist-generated
/entrypoint.php linguist-generated
2 changes: 2 additions & 0 deletions dagger/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/sdk
/vendor
Loading