Skip to content

Commit

Permalink
chore: wip 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 Mar 27, 2023
1 parent 45198d8 commit b1ceaf9
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 195 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/format.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/lint.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/release.yml

This file was deleted.

79 changes: 79 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
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: Check out the openapi-forge-javascript generator
uses: actions/checkout@v3
with:
repository: ScottLogic/openapi-forge-javascript
path: openapi-forge-javascript

- name: Install openapi-forge-javascript dependencies
run: |
cd openapi-forge-javascript
npm install
- name: Return to the main folder
run: |
cd ..
- name: Make script executable
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
- name: Test Generator Options Command
run: |
echo "generator-options<<EOF" >> $GITHUB_OUTPUT
echo "$(./src/index.js generator-options openapi-forge-javascript)" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
id: generator_options
# - name: Test Generator Options Command
# run: |
# ./src/index.js generator-options openapi-forge-javascript >> $GITHUB_OUTPUT
# id: generator_options

- name: Check Output of Generator Options
if: contains("something with moduleFormat", "moduleFormat") # steps.generator_options.outputs.generator-options
run: echo "hooray!"
if: "!contains("something with moduleFormat", "moduleFormat")" # steps.generator_options.outputs.generator-options
run: echo "oh noes!"

# - 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
32 changes: 0 additions & 32 deletions .github/workflows/test-forge.yml

This file was deleted.

78 changes: 0 additions & 78 deletions .github/workflows/test.yml

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "Effortlessly create OpenAPI clients from the fiery furnace of our forge",
"main": "src/generate.js",
"scripts": {
"prepare": "husky install",
"test:generators": "openapi-forge test-generators",
"test": "jest",
"format:check:all": "prettier --check .",
Expand Down

0 comments on commit b1ceaf9

Please sign in to comment.