diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index f937947..0000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Format - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - format: - name: Format - 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 ci - - - name: Code Format Check - run: npm run format:check:all \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 02b8bda..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Lint - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - lint: - name: Lint - 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 ci - - - name: Code Lint Check - run: npm run lint:check:all \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 26a3b9d..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Release - -on: - push: - branches: [master] - -jobs: - release: - name: Release - 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 ci - - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npx semantic-release \ No newline at end of file diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml new file mode 100644 index 0000000..727496f --- /dev/null +++ b/.github/workflows/smoke.yml @@ -0,0 +1,75 @@ +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=$("hello world")" >> $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 + run: | + echo "$(steps.generator_options.outputs)" + + # - 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 diff --git a/.github/workflows/test-forge.yml b/.github/workflows/test-forge.yml deleted file mode 100644 index 2783e6f..0000000 --- a/.github/workflows/test-forge.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Test Forge - -on: - push: - branches: - - "**" - pull_request: - branches: - - "**" - -jobs: - test-forge: - name: Test Forge - 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: Test Forge - run: | - npm test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 8c40908..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Test - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - test-generators: - name: Test - runs-on: windows-latest - - steps: - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 16.x - - # Must change shell because this workflow uses the windows-latest image - - name: Set npm shell - run: npm config set script-shell "C:\\Program Files\\Git\\bin\\bash.exe" - - - name: Check out openapi-forge repository - uses: actions/checkout@v3 - with: - path: openapi-forge - - - name: Install openapi-forge dependencies globally - run: | - cd openapi-forge - npm install - npm install --global - - - 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: Check out the openapi-forge-csharp generator - uses: actions/checkout@v3 - with: - repository: ScottLogic/openapi-forge-csharp - path: openapi-forge-csharp - - - name: Install openapi-forge-csharp dependencies - run: | - cd openapi-forge-csharp - npm install - - - name: Check out the openapi-forge-typescript generator - uses: actions/checkout@v3 - with: - repository: ScottLogic/openapi-forge-typescript - path: openapi-forge-typescript - - - name: Install openapi-forge-typescript dependencies - run: | - cd openapi-forge-typescript - npm install - - - name: Test generators - run: | - cd openapi-forge - openapi-forge test-generators --format json --generators openapi-forge-javascript openapi-forge-typescript openapi-forge-csharp > test-results.json - continue-on-error: true - - - name: Upload test results - uses: actions/upload-artifact@v3 - with: - name: test-results - path: openapi-forge/test-results.json \ No newline at end of file