Skip to content

Commit

Permalink
Merge pull request #615 from nfdi4plants/search_rework
Browse files Browse the repository at this point in the history
Search rework
  • Loading branch information
Freymaurer authored Feb 5, 2025
2 parents ff21890 + 2608049 commit 7cea49c
Show file tree
Hide file tree
Showing 110 changed files with 12,411 additions and 1,866 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
permissions:
contents: read
packages: write
#
#
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/PublishNpm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish NPM Package

on:
push:
branches: ['nightly']
workflow_dispatch: # Allows manual runs from the Actions tab

jobs:
publish-npm:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure all tags are fetched

- name: Extract Latest Tag as Version
id: get_version
run: echo "PACKAGE_VERSION=$(git describe --tags --always --dirty)" >> $GITHUB_ENV

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'

# Set up .NET
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x.x

# Restore .NET tools
- name: Restore .NET dependencies
run: dotnet tool restore

- name: Install NPM Dependencies
run: npm install
working-directory: src/Components

- name: Set Package Version
run: npm version --no-git-tag-version $PACKAGE_VERSION
working-directory: src/Componentes

- name: Build Package
run: npm run build
working-directory: src/Componentes
# - name: Publish to NPM
# run: npm publish --access public
# working-directory: src/Components
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/PublishNuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Nightly NuGet Package

on:
push:
branches: ['nightly'] # Only runs on pushes to the 'nightly' branch
workflow_dispatch: # Allows manual runs from the Actions tab

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x.x'

- name: Extract Latest Tag as Version
id: get_version
run: echo "PACKAGE_VERSION=$(git describe --tags --always --dirty)" >> $GITHUB_ENV

- name: Restore Dependencies
run: dotnet restore src/Components/src/Components.fsproj

- name: Install NPM Dependencies
run: npm install
working-directory: src/Components

- name: Run Prebuild Script
run: npm run prebuild:net
working-directory: src/Components

- name: Build Project
run: dotnet build src/Components/src/Components.fsproj --configuration Release /p:PackageVersion=${PACKAGE_VERSION}

- name: Pack NuGet Package
run: dotnet pack src/Components/src/Components.fsproj --configuration Release --output nupkgs /p:PackageVersion=${PACKAGE_VERSION}

# - name: Publish to NuGet
# run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
58 changes: 58 additions & 0 deletions .github/workflows/PublishStorybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Workflow name
name: Build and Publish Storybook to GitHub Pages

on:
# Event for the workflow to run on
push:
branches:
- 'nightly' # Replace with the branch you want to deploy from
workflow_dispatch: # Allows manual runs from the Actions tab

permissions:
contents: read
pages: write
id-token: write

# List of jobs
jobs:
deploy:
runs-on: ubuntu-latest
# Job steps
steps:

# Manual Checkout
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Set up Node
- uses: actions/setup-node@v4
with:
node-version: '20'

# Set up .NET
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x.x

# Restore .NET tools
- name: Restore .NET dependencies
run: dotnet tool restore

# Install dependencies
- name: Install npm dependencies
run: npm install
working-directory: src/Components

# Build the project
- name: Build
run: npm run build:storybook # this does not work currently, as it does not move the transpiled files from Shared to storybook-static

# #👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow
# - uses: bitovi/[email protected]
# with:
# install_command: echo "install skipped" # default: npm ci
# build_command: echo "build skipped" # default: npm run build-storybook
# path: src/Components/storybook-static # default: dist/storybook
# checkout: false # default: true
14 changes: 12 additions & 2 deletions .github/workflows/RunTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,21 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

# Install dependencies
# Install npm dependencies
- name: Install Node.js dependencies
run: npm install

# Install component npm dependencies
- name: Install Node.js dependencies
run: npm install
working-directory: src/Components

# Install playwright dependencies
- name: Install Playwright dependencies
run: npx playwright install chromium
working-directory: src/Components

- name: Run Tests
run: dotnet run --project ./build/Build.fsproj test
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ release.sh
/.db/neo4j
/src/Client/output
/tests/Client/output
/tests/Components/output
/.paket
*/**/fable_modules
*/**/*.fs.ts
dist/

*storybook.log
storybook-static/
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"**/bin": true,
"**/obj": true,
"**/deploy": true,
},
"[fsharp]": {
"editor.inlayHints.enabled": "off"
}
}
12 changes: 6 additions & 6 deletions Swate.sln
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Server.Tests", "tests\Serve
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Shared.Tests", "tests\Shared\Shared.Tests.fsproj", "{1B60E927-B1B4-4DC7-81D2-8A439E1F1FD9}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Components", "src\Components\Components.fsproj", "{0DF74712-21E3-4F88-BF86-F66960B6CD63}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Components", "src\Components\src\Components.fsproj", "{90F659B8-B8EB-4A3F-BDB2-E761B1F0811D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -78,10 +78,10 @@ Global
{1B60E927-B1B4-4DC7-81D2-8A439E1F1FD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B60E927-B1B4-4DC7-81D2-8A439E1F1FD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B60E927-B1B4-4DC7-81D2-8A439E1F1FD9}.Release|Any CPU.Build.0 = Release|Any CPU
{0DF74712-21E3-4F88-BF86-F66960B6CD63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0DF74712-21E3-4F88-BF86-F66960B6CD63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0DF74712-21E3-4F88-BF86-F66960B6CD63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0DF74712-21E3-4F88-BF86-F66960B6CD63}.Release|Any CPU.Build.0 = Release|Any CPU
{90F659B8-B8EB-4A3F-BDB2-E761B1F0811D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90F659B8-B8EB-4A3F-BDB2-E761B1F0811D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90F659B8-B8EB-4A3F-BDB2-E761B1F0811D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90F659B8-B8EB-4A3F-BDB2-E761B1F0811D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -94,7 +94,7 @@ Global
{C95ADFEC-4D46-4AD4-BD20-3F5EA99C26CA} = {F5C1D7C6-F9B9-4DDC-9F67-F5729F46B1BB}
{79BB1360-1B14-4B98-83AA-343E6B14BECE} = {F5C1D7C6-F9B9-4DDC-9F67-F5729F46B1BB}
{1B60E927-B1B4-4DC7-81D2-8A439E1F1FD9} = {F5C1D7C6-F9B9-4DDC-9F67-F5729F46B1BB}
{0DF74712-21E3-4F88-BF86-F66960B6CD63} = {E0FF3176-0B77-4662-A2A8-7233E5E59981}
{90F659B8-B8EB-4A3F-BDB2-E761B1F0811D} = {E0FF3176-0B77-4662-A2A8-7233E5E59981}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7A0AA30E-4CD9-4359-9513-BA68E2E85245}
Expand Down
9 changes: 6 additions & 3 deletions build/Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ let sharedPath = Path.getFullName "src/Shared"
let serverPath = Path.getFullName "src/Server"
let clientPath = Path.getFullName "src/Client"
let deployPath = Path.getFullName "deploy"


let sharedTestsPath = Path.getFullName "tests/Shared"
let serverTestsPath = Path.getFullName "tests/Server"
let clientTestsPath = Path.getFullName "tests/Client"
let componentTestsPath = Path.getFullName "src/Components"

let dockerComposePath = Path.getFullName ".db/docker-compose.yml"

Expand Down Expand Up @@ -354,17 +357,17 @@ module Tests =
[
"server", dotnet [ "watch"; "run" ] serverTestsPath
// This below will start web ui for tests, but cannot execute due to office-addin-mock
//"client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npx"; "vite" ] clientTestsPath
"client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npx"; "mocha"; $"{clientTestsPath}/output/Client.Tests.js"; "--watch" ] clientTestsPath
"components", npm [ "run"; "test" ] componentTestsPath
]
|> runParallel

let Run() =
[
"server", dotnet [ "run" ] serverTestsPath
"client", dotnet [ "fable"; "-o"; "output"; "-s"; "--run"; "npx"; "mocha"; $"{clientTestsPath}/output/Client.Tests.js" ] clientTestsPath
]|> runParallel
run npm [ "run"; "test:run" ] "."
"components", npm [ "run"; "test:run" ] componentTestsPath
] |> runParallel

Target.create "Format" (fun _ ->
run dotnet [ "fantomas"; "."; "-r" ] "src"
Expand Down
Loading

0 comments on commit 7cea49c

Please sign in to comment.