Skip to content

Commit

Permalink
GitHub Actions workflow to demo it (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Mar 11, 2024
1 parent 9c0af38 commit 78ad613
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 39 deletions.
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

0 comments on commit 78ad613

Please sign in to comment.