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

GitHub Actions workflow to demo it #7

Merged
merged 4 commits into from
Mar 11, 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
94 changes: 64 additions & 30 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,39 +67,70 @@ jobs:
run: OUTPUT=junit make demo-github --no-print-directory
continue-on-error: true

php:
name: Pure PHP

github-actions:
name: GitHub Actions
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: 👍 Valid CSV file
uses: jbzoo/csv-blueprint@master
with:
php-version: 8.3
tools: composer
csv: tests/fixtures/demo.csv
schema: tests/schemas/demo_valid.yml

- name: Build the Project
run: make build-install --no-print-directory
- name: 👎 Invalid CSV file - Report as GitHub Annotations
uses: jbzoo/csv-blueprint@master
with:
csv: tests/fixtures/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: tests/fixtures/demo.csv
schema: tests/schemas/demo_invalid.yml
output: table
continue-on-error: true


docker:
name: Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Pull Docker Image
run: docker pull jbzoo/csv-blueprint

- name: 👍 Valid CSV file
run: |
./csv-blueprint \
docker run \
-v `pwd`:/parent-host \
--rm jbzoo/csv-blueprint \
validate:csv \
--csv=./tests/fixtures/demo.csv \
--schema=./tests/schemas/demo_valid.yml
--csv=/parent-host/tests/fixtures/demo.csv \
--schema=/parent-host/tests/schemas/demo_valid.yml

- name: 👎 Invalid CSV file
run: |
./csv-blueprint \
docker run \
-v `pwd`:/parent-host \
--rm jbzoo/csv-blueprint \
validate:csv \
--csv=./tests/fixtures/demo.csv \
--schema=./tests/schemas/demo_invalid.yml
--csv=/parent-host/tests/fixtures/demo.csv \
--schema=/parent-host/tests/schemas/demo_invalid.yml
continue-on-error: true


phar:
name: Phar
runs-on: ubuntu-latest
Expand All @@ -119,47 +150,50 @@ jobs:
run: make build --no-print-directory

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

- name: 👎 Invalid CSV file
run: |
run: |
./build/csv-blueprint.phar \
validate:csv \
--csv=./tests/fixtures/demo.csv \
--schema=./tests/schemas/demo_invalid.yml
continue-on-error: true

docker:
name: Docker Hub

php:
name: Pure PHP
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Pull Docker Image
run: docker pull jbzoo/csv-blueprint
- 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: |
docker run \
-v `pwd`:/parent-host \
--rm jbzoo/csv-blueprint \
./csv-blueprint \
validate:csv \
--csv=/parent-host/tests/fixtures/demo.csv \
--schema=/parent-host/tests/schemas/demo_valid.yml
--csv=./tests/fixtures/demo.csv \
--schema=./tests/schemas/demo_valid.yml

- name: 👎 Invalid CSV file
run: |
docker run \
-v `pwd`:/parent-host \
--rm jbzoo/csv-blueprint \
./csv-blueprint \
validate:csv \
--csv=/parent-host/tests/fixtures/demo.csv \
--schema=/parent-host/tests/schemas/demo_invalid.yml
--csv=./tests/fixtures/demo.csv \
--schema=./tests/schemas/demo_invalid.yml
continue-on-error: true
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,25 @@ jobs:
- name: Reporting example via Docker
run: make demo-docker --no-print-directory
continue-on-error: true

github-action:
name: GitHub Action
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 👍 Valid CSV file
uses: ./
with:
csv: tests/fixtures/demo.csv
schema: tests/schemas/demo_valid.yml

- name: 👎 Invalid CSV file
uses: ./
with:
csv: tests/fixtures/demo.csv
schema: tests/schemas/demo_invalid.yml
continue-on-error: true
9 changes: 0 additions & 9 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,12 @@ on:
push:
branches:
- 'master'
pull_request:
branches:
- "*"

jobs:
docker:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand Down
Loading