From 47de0da9e4d7d726e5b5db7dd41af3143421ee66 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Nov 2021 17:05:24 +0900 Subject: [PATCH 1/5] Add error profile --- .github/workflows/error.yml | 27 +++++++++++++++++++++++++++ tests/profile/error.xml | 11 +++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/error.yml create mode 100644 tests/profile/error.xml diff --git a/.github/workflows/error.yml b/.github/workflows/error.yml new file mode 100644 index 0000000..938f98e --- /dev/null +++ b/.github/workflows/error.yml @@ -0,0 +1,27 @@ +name: "Error" + +on: + ["push", "workflow_dispatch"] + +jobs: + asd: + runs-on: ubuntu-latest + name: ASD documents + steps: + + - name: Checkout + uses: actions/checkout@v2 + + - name: Error profile + id: asd + uses: ./ # Uses an action in the root directory + with: + profile: tests/profile/error.xml + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ${{ steps.asd.outputs.dir}} + destination_dir: ${{ steps.asd.outputs.dir}} + diff --git a/tests/profile/error.xml b/tests/profile/error.xml new file mode 100644 index 0000000..49d7206 --- /dev/null +++ b/tests/profile/error.xml @@ -0,0 +1,11 @@ + + + Error + + + + + + From 7d53ed3b33de03ee9dbee1df054196ca0fead6cb Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Nov 2021 17:29:45 +0900 Subject: [PATCH 2/5] Exit 1 when php error detected --- entrypoint.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 0d6d936..1bfe4ba 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,5 +3,11 @@ composer require koriym/app-state-diagram dirname=$(dirname $2) ./vendor/bin/asd --config=$1 $2 -echo "Output Directory: $dirname" -echo "::set-output name=dir::$dirname" +/usr/bin/php hoge.php +if [ $? -ne "0" ]; then + echo "ASD error" + exit 1 +else + echo "Output Directory: $dirname" + echo "::set-output name=dir::$dirname" +fi From eda7bc35b426ee65663bb1803f7fb04d250d7955 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Nov 2021 17:34:39 +0900 Subject: [PATCH 3/5] Run on local Dockerfile --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f42d4ec..bfa49ad 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,7 @@ inputs: default: profile.xml runs: using: docker - image: docker://ghcr.io/koriym/asd-action + image: Dockerfile args: - ${{ inputs.config }} - ${{ inputs.profile }} From ffa54a5c292cb5b3631981ec921de72bfc2898c7 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Nov 2021 17:40:44 +0900 Subject: [PATCH 4/5] Revert "Run on local Dockerfile" This reverts commit eda7bc35b426ee65663bb1803f7fb04d250d7955. --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index bfa49ad..f42d4ec 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,7 @@ inputs: default: profile.xml runs: using: docker - image: Dockerfile + image: docker://ghcr.io/koriym/asd-action args: - ${{ inputs.config }} - ${{ inputs.profile }} From 9686f879547db4651008def29145fa30c3cda2a2 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Mon, 22 Nov 2021 00:06:54 +0900 Subject: [PATCH 5/5] Update entrypoint.sh gc Co-authored-by: Naoki Tsuchiya --- entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 1bfe4ba..57cc4fb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,7 +3,6 @@ composer require koriym/app-state-diagram dirname=$(dirname $2) ./vendor/bin/asd --config=$1 $2 -/usr/bin/php hoge.php if [ $? -ne "0" ]; then echo "ASD error" exit 1