-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Apply linting everywhere * syncpack config * Add sonar project files * Add vitest * Github action to test each project has changed. If a project has not changed the sonarqube analysis is skipped
- Loading branch information
1 parent
ba84d31
commit f19943d
Showing
19 changed files
with
985 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: ishtar-ci | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- main | ||
|
@@ -22,4 +23,74 @@ jobs: | |
- name: format | ||
run: pnpm format:check | ||
- name: build | ||
run: pnpm build | ||
run: pnpm build | ||
|
||
changes: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
dashboard: ${{ steps.changes.outputs.dashboard }} | ||
react-frontend: ${{ steps.changes.outputs.react-frontend }} | ||
docs: ${{ steps.changes.outputs.docs }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dorny/paths-filter@v2 | ||
id: changes | ||
with: | ||
filters: | | ||
dashboard: | ||
- 'apps/dashboard/**' | ||
react-frontend: | ||
- 'apps/dashboard/**' | ||
docs: | ||
- 'docs/starlight/**' | ||
dashboard: | ||
name: Sonarqube Dashboard | ||
needs: changes | ||
if: ${{ needs.changes.outputs.dashboard == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
with: | ||
projectBaseDir: apps/dashboard/ | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_DASHBOARD }} | ||
|
||
docs: | ||
name: Sonarqube Docs | ||
needs: changes | ||
if: ${{ needs.changes.outputs.docs == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
with: | ||
projectBaseDir: docs/starlight/ | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_DOCS }} | ||
|
||
react-frontend: | ||
name: Sonarqube React Frontend | ||
needs: changes | ||
if: ${{ needs.changes.outputs.react-frontend == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
with: | ||
projectBaseDir: apps/react-frontend/ | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_REACT_FRONTEND }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ dist | |
dist-ssr | ||
.astro/ | ||
*.local | ||
coverage | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"semverGroups": [ | ||
{ | ||
"range": "" | ||
} | ||
], | ||
"versionGroups": [ | ||
{ | ||
"dependencies": ["@gg-monorepo"], | ||
"isIgnored": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
{ | ||
"name": "dashboard", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview" | ||
}, | ||
"name": "@gg-monorepo/dashboard", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"solid-js": "1.8.7" | ||
}, | ||
"devDependencies": { | ||
"typescript": "5.3.3", | ||
"vite": "5.0.10", | ||
"vite-plugin-solid": "2.8.0" | ||
} | ||
"vite-plugin-solid": "2.8.0", | ||
"vitest": "^1.1.0" | ||
}, | ||
"private": true, | ||
"scripts": { | ||
"build": "tsc && vite build", | ||
"coverage": "vitest run --coverage", | ||
"dev": "vite", | ||
"format:check": "biome format ./src", | ||
"format:write": "biome format --write ./src", | ||
"lint": "biome lint ./src", | ||
"lint:fix": "biome check --apply ./src", | ||
"preview": "vite preview" | ||
}, | ||
"type": "module" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sonar.projectKey=nigelbreslaw_guardian-ghost_dashboard | ||
sonar.organization=nigelbreslaw | ||
sonar.javascript.lcov.reportPaths=coverage/lcov.info | ||
|
||
# This is the name and version displayed in the SonarCloud UI. | ||
#sonar.projectName=nigelbreslaw_guardian-ghost_dashboard | ||
#sonar.projectVersion=1.0 | ||
|
||
|
||
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. | ||
#sonar.sources=. | ||
|
||
# Encoding of the source code. Default is default system encoding | ||
#sonar.sourceEncoding=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,30 @@ | ||
import { createSignal } from 'solid-js' | ||
import solidLogo from './assets/solid.svg' | ||
import viteLogo from '/vite.svg' | ||
import './App.css' | ||
import { createSignal } from "solid-js"; | ||
import viteLogo from "/vite.svg"; | ||
import "./App.css"; | ||
import solidLogo from "./assets/solid.svg"; | ||
|
||
function App() { | ||
const [count, setCount] = createSignal(0) | ||
const [count, setCount] = createSignal(0); | ||
|
||
return ( | ||
<> | ||
<div> | ||
<a href="https://vitejs.dev" target="_blank"> | ||
<img src={viteLogo} class="logo" alt="Vite logo" /> | ||
</a> | ||
<a href="https://solidjs.com" target="_blank"> | ||
<img src={solidLogo} class="logo solid" alt="Solid logo" /> | ||
</a> | ||
</div> | ||
<h1>Placeholder for dashboard!</h1> | ||
<div class="card"> | ||
<button onClick={() => setCount((count) => count + 1)}> | ||
count is {count()} | ||
</button> | ||
<p> | ||
Developer stats coming soon. | ||
</p> | ||
</div> | ||
|
||
</> | ||
) | ||
return ( | ||
<> | ||
<div> | ||
<a href="https://vitejs.dev" target="_blank" rel="noreferrer"> | ||
<img src={viteLogo} class="logo" alt="Vite logo" /> | ||
</a> | ||
<a href="https://solidjs.com" target="_blank" rel="noreferrer"> | ||
<img src={solidLogo} class="logo solid" alt="Solid logo" /> | ||
</a> | ||
</div> | ||
<h1>Placeholder for dashboard!</h1> | ||
<div class="card"> | ||
<button type="button" onClick={() => setCount((count) => count + 1)}> | ||
count is {count()} | ||
</button> | ||
<p>Developer stats coming soon.</p> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default App | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/* @refresh reload */ | ||
import { render } from 'solid-js/web' | ||
import { render } from "solid-js/web"; | ||
|
||
import './index.css' | ||
import App from './App' | ||
import App from "./App"; | ||
import "./index.css"; | ||
|
||
const root = document.getElementById('root') | ||
const root = document.getElementById("root"); | ||
|
||
render(() => <App />, root!) | ||
render(() => <App />, root!); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineConfig } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
test: { | ||
coverage: { | ||
reporter: ['lcov'], | ||
}, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
{ | ||
"name": "@gg-monorepo/react-frontend", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"source-map-explorer": "2.5.3" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "18.2.45", | ||
"@types/react-dom": "18.2.18", | ||
"@vitejs/plugin-react-swc": "3.5.0", | ||
"typescript": "5.3.3", | ||
"vite": "5.0.10", | ||
"vite-plugin-mkcert": "1.17.1", | ||
"vitest": "^1.1.0" | ||
}, | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"analyze": "source-map-explorer dist/**/*.js", | ||
"build": "vite build", | ||
"coverage": "vitest run --coverage", | ||
"dev": "vite", | ||
"dev:bun": "bunx --bun vite", | ||
"format:check": "biome format ./src", | ||
"format:write": "biome format --write ./src", | ||
"lint": "biome lint ./src", | ||
"lint:fix": "biome check --apply ./src", | ||
"preview": "vite preview", | ||
"typecheck": "tsc" | ||
}, | ||
"dependencies": { | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"source-map-explorer": "2.5.3" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "18.2.45", | ||
"@types/react-dom": "18.2.18", | ||
"@vitejs/plugin-react-swc": "3.5.0", | ||
"typescript": "5.3.3", | ||
"vite": "5.0.10", | ||
"vite-plugin-mkcert": "1.17.1" | ||
} | ||
"type": "module" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sonar.projectKey=nigelbreslaw_guardian-ghost_react-frontend | ||
sonar.organization=nigelbreslaw | ||
sonar.javascript.lcov.reportPaths=coverage/lcov.info | ||
|
||
# This is the name and version displayed in the SonarCloud UI. | ||
#sonar.projectName=nigelbreslaw_guardian-ghost_react-frontend | ||
#sonar.projectVersion=1.0 | ||
|
||
|
||
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. | ||
#sonar.sources=. | ||
|
||
# Encoding of the source code. Default is default system encoding | ||
#sonar.sourceEncoding=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineConfig } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
test: { | ||
coverage: { | ||
reporter: ['lcov'], | ||
}, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
{ | ||
"name": "@gg-monorepo/starlight", | ||
"type": "module", | ||
"version": "0.0.1", | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "astro check && astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"@astrojs/starlight": "0.15.1", | ||
"astro": "4.0.7", | ||
"sharp": "0.33.1" | ||
}, | ||
"devDependencies": { | ||
"@astrojs/check": "0.3.4", | ||
"typescript": "5.3.3" | ||
} | ||
} | ||
"typescript": "5.3.3", | ||
"vitest": "^1.1.0" | ||
}, | ||
"scripts": { | ||
"astro": "astro", | ||
"build": "astro check && astro build", | ||
"coverage": "vitest run --coverage", | ||
"dev": "astro dev", | ||
"format:check": "biome format ./src", | ||
"format:write": "biome format --write ./src", | ||
"lint": "biome lint ./src", | ||
"lint:fix": "biome check --apply ./src", | ||
"preview": "astro preview", | ||
"start": "astro dev" | ||
}, | ||
"type": "module" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sonar.projectKey=nigelbreslaw_guardian-ghost_starlight | ||
sonar.organization=nigelbreslaw | ||
sonar.javascript.lcov.reportPaths=coverage/lcov.info | ||
|
||
# This is the name and version displayed in the SonarCloud UI. | ||
#sonar.projectName=nigelbreslaw_guardian-ghost_starlight | ||
#sonar.projectVersion=1.0 | ||
|
||
|
||
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. | ||
#sonar.sources=. | ||
|
||
# Encoding of the source code. Default is default system encoding | ||
#sonar.sourceEncoding=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { defineCollection } from 'astro:content'; | ||
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema'; | ||
import { docsSchema, i18nSchema } from "@astrojs/starlight/schema"; | ||
import { defineCollection } from "astro:content"; | ||
|
||
export const collections = { | ||
docs: defineCollection({ schema: docsSchema() }), | ||
i18n: defineCollection({ type: 'data', schema: i18nSchema() }), | ||
i18n: defineCollection({ type: "data", schema: i18nSchema() }), | ||
}; |
Oops, something went wrong.