Skip to content

Commit

Permalink
chore: add smoke test for generator-options command (ScottLogic#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
ms14981 committed Feb 10, 2023
1 parent 2d63fdb commit 3ca46a7
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Smoke Tests

on:
push:
branches:
- "**"
pull_request:
branches:
- "**"

jobs:
smoke-tests:
name: Smoke Tests
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'

- name: Install Node.js dependencies
run: |
npm install
- name: Make script executable
run: |
chmod +x ./src/index.js
- name: Test Generator Options Command
run: |
echo "./src/index.js generator-options openapi-forge-javascript\n" >> $GITHUB_OUTPUT
id: generator_options

- name: Check Output of Generator Options
run: |
echo "Checking the output for moduleFormat"
if grep -q "moduleFormat" <${{join(steps.run_tests.outputs.*, '\n')}}; then
echo "Output includes moduleFormat"
else
echo "ERROR: Output does not include moduleFormat"
echo "Full Output: ${{join(steps.run_tests.outputs.*, '\n')}}"
exit 1
fi

0 comments on commit 3ca46a7

Please sign in to comment.