diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 6851c2c..a1407ad 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -46,10 +46,6 @@ jobs: run: | chmod +x ./src/index.js - # - name: Test Generator Options Command - # run: | - # echo "generator-options=$(./src/index.js generator-options openapi-forge-javascript)" >> $GITHUB_OUTPUT - # id: generator_options - id: generator_options name: Test Generator Options Command run: | @@ -71,13 +67,23 @@ jobs: echo "expected generator-options command to produce the moduleFormat option for the JavaScript generator" exit 1 - # - name: Check Output of Generator Options - # run: | - # echo "Checking the output for moduleFormat" - # if grep -q "moduleFormat" <${{join(steps.generator_options.outputs.*, '\n')}}; then - # echo "Output includes moduleFormat" - # else - # echo "ERROR: Output does not include moduleFormat" - # echo "Full Output: ${{join(steps.generator_options.outputs.*, '\n')}}" - # exit 1 - # fi + - id: test_generators + name: Test Generator Options Command + run: | + echo "test-generators<> $GITHUB_OUTPUT + echo "$(./src/index.js test-generators --generators openapi-forge-typescript --format "json")" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Print test-generators command STDOUT + run: echo "${{ steps.generator_options.outputs.test-generators }}" + + - name: Check Output of Test Generators 1 + if: ${{ fromJson(steps.generator_options.outputs.test-generators).scenarios > 0 && fromJson(steps.generator_options.outputs.test-generators).scenarios == fromJson(steps.generator_options.outputs.test-generators).passed }} + run: | + echo "test-generators command succeeded!" + + - name: Check Output of Test Generators 2 + if: ${{ fromJson(steps.generator_options.outputs.test-generators).scenarios > 0 && fromJson(steps.generator_options.outputs.test-generators).scenarios == fromJson(steps.generator_options.outputs.test-generators).passed }} + run: | + echo "expected test-generators command to show that all tests for the TypeScript generator are passing" + exit 1 \ No newline at end of file