Skip to content

Commit

Permalink
Merge pull request #23 from event-catalog/adding-windows-tests
Browse files Browse the repository at this point in the history
chore(plugin): added windows tests to cicd
  • Loading branch information
boyney123 authored Oct 3, 2024
2 parents 2fb077c + d7ed60c commit ff22624
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-windows-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@eventcatalog/generator-openapi": minor
---

chore(plugin): fixed issues with windows OS
21 changes: 17 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Make sure the EventCatalog can build OK
name: Tests

on:
Expand All @@ -10,15 +9,29 @@ on:
- main

jobs:
build:
name: Tests
build-ubuntu:
name: Tests on Ubuntu
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
- name: Installation
run: pnpm install
- name: Run tests
run: pnpm run test

build-windows:
name: Tests on Windows
timeout-minutes: 30
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Installation
run: pnpm install
- name: Run tests
Expand Down
3 changes: 2 additions & 1 deletion src/utils/services.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { OpenAPI } from 'openapi-types';
import slugify from 'slugify';
import { Service } from '../types';
import path from 'path';

export const defaultMarkdown = (document: OpenAPI.Document, fileName: string) => {
return `
Expand Down Expand Up @@ -28,7 +29,7 @@ export const getSummary = (document: OpenAPI.Document) => {
};

export const buildService = (serviceOptions: Service, document: OpenAPI.Document) => {
const schemaPath = serviceOptions.path.split('/').pop() || 'openapi.yml';
const schemaPath = path.basename(serviceOptions.path) || 'openapi.yml';
const documentTags = document.tags || [];
const serviceId = serviceOptions.id || slugify(document.info.title, { lower: true, strict: true });
return {
Expand Down

0 comments on commit ff22624

Please sign in to comment.