Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New validation rules and refactoring #23

Merged
merged 17 commits into from
Mar 14, 2024
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
66 changes: 4 additions & 62 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ jobs:
--rm jbzoo/csv-blueprint \
validate:csv \
--csv=/parent-host/tests/fixtures/batch/*.csv \
--schema=/parent-host/tests/schemas/demo_valid.yml
--schema=/parent-host/tests/schemas/demo_valid.yml \
--ansi

- name: 👎 Invalid CSV file
run: |
Expand All @@ -110,64 +111,5 @@ jobs:
--rm jbzoo/csv-blueprint \
validate:csv \
--csv=/parent-host/tests/fixtures/batch/*.csv \
--schema=/parent-host/tests/schemas/demo_invalid.yml


phar:
name: Phar
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer

- name: Build the project
run: make build --no-print-directory

- name: 👍 Valid CSV file
run: |
./build/csv-blueprint.phar \
validate:csv \
--csv=./tests/fixtures/batch/*.csv \
--schema=./tests/schemas/demo_valid.yml

- name: 👎 Invalid CSV file
run: |
! ./build/csv-blueprint.phar \
validate:csv \
--csv=./tests/fixtures/batch/*.csv \
--schema=./tests/schemas/demo_invalid.yml


php:
name: Pure PHP
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer

- name: Build the Project
run: make build-install --no-print-directory

- name: 👍 Valid CSV file
run: |
./csv-blueprint \
validate:csv \
--csv=./tests/fixtures/batch/*.csv \
--schema=./tests/schemas/demo_valid.yml

- name: 👎 Invalid CSV file
run: |
! ./csv-blueprint \
validate:csv \
--csv=./tests/fixtures/batch/*.csv \
--schema=./tests/schemas/demo_invalid.yml
--schema=/parent-host/tests/schemas/demo_invalid.yml \
--ansi
87 changes: 72 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,35 +139,76 @@ jobs:
name: Reports - ${{ matrix.php-version }}
path: build/

phar:
name: Phar

test-php-binary:
name: Verify PHP binary
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer

- name: Build the Project
run: make build-install --no-print-directory

- name: 👍 Valid CSV file
run: |
./csv-blueprint \
validate:csv \
--csv=./tests/fixtures/batch/*.csv \
--schema=./tests/schemas/demo_valid.yml

- name: 👎 Invalid CSV file
run: |
! ./csv-blueprint \
validate:csv \
--csv=./tests/fixtures/batch/*.csv \
--schema=./tests/schemas/demo_invalid.yml


test-phar:
name: Verify PHAR
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 8.1, 8.2, 8.3 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: composer
extensions: ast

- name: Build the project
run: make build --no-print-directory

- name: Building Phar binary file
run: make build-phar --no-print-directory

- name: Trying to use the phar file
- name: Test help and logo
run: ./build/csv-blueprint.phar

- name: 👍 Valid CSV file
run: |
./build/csv-blueprint.phar \
validate:csv \
--csv=./tests/fixtures/batch/*.csv \
--schema=./tests/schemas/demo_valid.yml \
--ansi

- name: 👎 Invalid CSV file
run: |
! ./build/csv-blueprint.phar \
validate:csv \
--csv=./tests/fixtures/batch/*.csv \
--schema=./tests/schemas/demo_invalid.yml \
--ansi

- name: Upload Artifacts
uses: actions/upload-artifact@v3
continue-on-error: true
Expand All @@ -177,7 +218,7 @@ jobs:


docker:
name: Docker
name: Verify Docker
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -186,9 +227,25 @@ jobs:
- name: 🐳 Building Docker Image
run: make build-docker

- name: Trying to use the Docker Image
- name: Test help and logo
run: docker run --rm jbzoo/csv-blueprint --ansi

- name: Reporting example via Docker
run: make demo-docker --no-print-directory
continue-on-error: true
- name: 👍 Valid CSV file
run: |
docker run --rm \
-v `pwd`:/parent-host \
jbzoo/csv-blueprint \
validate:csv \
--csv=/parent-host/tests/fixtures/demo.csv \
--schema=/parent-host/tests/schemas/demo_valid.yml \
--ansi

- name: 👎 Invalid CSV file
run: |
! docker run --rm \
-v `pwd`:/parent-host \
jbzoo/csv-blueprint \
validate:csv \
--csv=/parent-host/tests/fixtures/demo.csv \
--schema=/parent-host/tests/schemas/demo_invalid.yml \
--ansi
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@

.PHONY: build

REPORT ?= table
COLUMNS_TEST ?= 150

ifneq (, $(wildcard ./vendor/jbzoo/codestyle/src/init.Makefile))
include ./vendor/jbzoo/codestyle/src/init.Makefile
endif

REPORT ?= table

build: ##@Project Install all 3rd party dependencies
$(call title,"Install/Update all 3rd party dependencies")
Expand Down
Loading
Loading