-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Denis Smet
committed
Mar 11, 2024
1 parent
0c40e6c
commit 23c9447
Showing
6 changed files
with
158 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# | ||
# JBZoo Toolbox - Csv-Blueprint. | ||
# | ||
# This file is part of the JBZoo Toolbox project. | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# @license MIT | ||
# @copyright Copyright (C) JBZoo.com, All rights reserved. | ||
# @see https://github.com/JBZoo/Csv-Blueprint | ||
# | ||
|
||
name: Demo | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
github-actions: | ||
name: GitHub Actions | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 👍 Valid CSV file | ||
uses: jbzoo/csv-blueprint@master | ||
with: | ||
csv: files/demo.csv | ||
schema: tests/schemas/demo_valid.yml | ||
|
||
- name: 👎 Invalid CSV file - Report as GitHub Annotations | ||
uses: jbzoo/csv-blueprint@master | ||
with: | ||
csv: files/demo.csv | ||
schema: tests/schemas/demo_invalid.yml | ||
continue-on-error: true | ||
|
||
- name: 👎 Invalid CSV file - Report as Table | ||
uses: jbzoo/csv-blueprint@master | ||
with: | ||
csv: files/demo.csv | ||
schema: tests/schemas/demo_invalid.yml | ||
output: table | ||
continue-on-error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,12 @@ | ||
# Csv-Blueprint-Demo | ||
# JBZoo / Csv-Blueprint-Demo | ||
|
||
[![CI](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/demo.yml/badge.svg?branch=master)](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/demo.yml?query=branch%3Amaster) | ||
|
||
It's just a simple example of how to use the [Csv-Blueprint](https://github.com/JBZoo/Csv-Blueprint); | ||
|
||
### See GitHub Actions for more details | ||
|
||
* [.github/workflows/demo.yml](.github/workflows/demo.yml) | ||
* [demo.csv](files/demo.csv) | ||
* [demo_invalid.yml](files/demo_invalid.yml) | ||
* [demo_valid.yml](files/demo_valid.yml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Name,City,Float,Birthday,Favorite color | ||
Clyde,Rivsikgo,4825.1856,2000-01-01,green | ||
Elsie,Vonavka,03.6544,2000-12-01,green | ||
Derek,Sarefunaw,-177.9088,2000-01-31,green | ||
Dylan,Wufolu,74605.944,1998-02-28,blue | ||
Carl,Gorriju,0.8431,1955-05-14,red | ||
Landon,Mojebol,123.64,1989-05-15,red | ||
Olive,Pebiogu,0,1955-05-14,green | ||
Willie,Sowaah,0.001,2010-07-20,red | ||
Derrick,Rakufag,42,1990-09-10,green | ||
Lois,Mofninle,-19366059127.6032,1988-08-24,green |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# JBZoo Toolbox - Csv-Blueprint. | ||
# | ||
# This file is part of the JBZoo Toolbox project. | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# @license MIT | ||
# @copyright Copyright (C) JBZoo.com, All rights reserved. | ||
# @see https://github.com/JBZoo/Csv-Blueprint | ||
# | ||
|
||
columns: | ||
- name: Name | ||
rules: | ||
not_empty: true | ||
min_length: 5 | ||
max_length: 7 | ||
|
||
- name: | ||
rules: | ||
not_empty: true | ||
only_capitalize: true | ||
|
||
- name: Float | ||
rules: | ||
not_empty: true | ||
is_float: true | ||
min: -19366059128 | ||
max: 74605 | ||
|
||
- name: Birthday | ||
rules: | ||
not_empty: true | ||
date_format: Y-m-d | ||
min_date: "1955-05-15" | ||
max_date: "2009-01-01" | ||
|
||
- name: Favorite color | ||
rules: | ||
not_empty: true | ||
allow_values: [ red, green, Blue ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# | ||
# JBZoo Toolbox - Csv-Blueprint. | ||
# | ||
# This file is part of the JBZoo Toolbox project. | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# @license MIT | ||
# @copyright Copyright (C) JBZoo.com, All rights reserved. | ||
# @see https://github.com/JBZoo/Csv-Blueprint | ||
# | ||
|
||
columns: | ||
- name: Name | ||
rules: | ||
not_empty: true | ||
min_length: 4 | ||
max_length: 7 | ||
|
||
- name: City | ||
rules: | ||
not_empty: true | ||
only_capitalize: true | ||
|
||
- name: Float | ||
rules: | ||
not_empty: true | ||
is_float: true | ||
min: -19366059128 | ||
max: 74606 | ||
|
||
- name: Birthday | ||
rules: | ||
not_empty: true | ||
date_format: Y-m-d | ||
|
||
- name: Favorite color | ||
rules: | ||
not_empty: true | ||
allow_values: [ red, green, blue ] |