From 02f47c68a4ff0d2ba0d2ce3fd6d3dcd4cadee77e Mon Sep 17 00:00:00 2001 From: Thomas Constantine Moore Date: Wed, 11 Sep 2024 15:59:01 -0400 Subject: [PATCH] ordering? --- .github/workflows/test.yml | 22 ++++++++++++++++++++++ .github/workflows/test_failure.yml | 24 ------------------------ 2 files changed, 22 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/test_failure.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b4b616..35ebd22 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,3 +12,25 @@ jobs: with: schema-url: https://raw.githubusercontent.com/thomasmost/gha-valjean/main/schema/example.schema.json target-dir: samples + test_invalid: + name: Test Invalid + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Test Local Action + id: test_failure + uses: ./ + with: + schema-url: https://raw.githubusercontent.com/thomasmost/gha-valjean/main/schema/example.schema.json + target-dir: samples_bad + continue-on-error: true # Allow the job to continue even if this step fails + + - name: Fail the job if the previous step succeeded + if: success() || steps.test_failure.outcome == 'success' + run: exit 1 # This will fail the job + + - name: Check if the previous step failed and pass the job if it did + if: failure() || steps.test_failure.outcome == 'failure' + run: echo "Expected failure occurred, job will pass." + diff --git a/.github/workflows/test_failure.yml b/.github/workflows/test_failure.yml deleted file mode 100644 index 34b3265..0000000 --- a/.github/workflows/test_failure.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Test -on: push -jobs: - test: - name: Test Invalid - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Test Local Action - id: test_failure - uses: ./ - with: - schema-url: https://raw.githubusercontent.com/thomasmost/gha-valjean/main/schema/example.schema.json - target-dir: samples_bad - continue-on-error: true # Allow the job to continue even if this step fails - - - name: Check if the previous step failed and pass the job if it did - if: failure() || steps.test_failure.outcome == 'failure' - run: echo "Expected failure occurred, job will pass." - - - name: Fail the job if the previous step succeeded - if: success() || steps.test_failure.outcome == 'success' - run: exit 1 # This will fail the job