diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index df24c2b9f..f967c40f9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Linting with biomejs +name: Linting backend on: push @@ -14,6 +14,7 @@ jobs: dht-node: ${{ steps.dht-node.outputs.success }} dlt-connector: ${{ steps.dlt-connector.outputs.success }} federation: ${{ steps.federation.outputs.success }} + name: Linting backend modules steps: - name: Checkout uses: actions/checkout@v4 @@ -68,68 +69,4 @@ jobs: run: | cd ./federation biome ci . - echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT - - lint_config_schema: - name: Lint - Config-Schema - needs: lint - runs-on: ubuntu-latest - steps: - - name: Check result from previous step - run: if [ "${{ needs.lint.outputs.config-schema }}" != "true" ]; then exit 1; fi - - lint_shared: - name: Lint - Shared - needs: lint - runs-on: ubuntu-latest - steps: - - name: Check result from previous step - run: if [ "${{ needs.lint.outputs.shared }}" != "true" ]; then exit 1; fi - - lint_core: - name: Lint - Core - needs: lint - runs-on: ubuntu-latest - steps: - - name: Check result from previous step - run: if [ "${{ needs.lint.outputs.core }}" != "true" ]; then exit 1; fi - - lint_backend: - name: Lint - Backend - needs: lint - runs-on: ubuntu-latest - steps: - - name: Check result from previous step - run: if [ "${{ needs.lint.outputs.backend }}" != "true" ]; then exit 1; fi - - lint_database: - name: Lint - Database Up - needs: lint - runs-on: ubuntu-latest - steps: - - name: Check result from previous step - run: if [ "${{ needs.lint.outputs.database }}" != "true" ]; then exit 1; fi - - lint_dht_node: - name: Lint - DHT Node - needs: lint - runs-on: ubuntu-latest - steps: - - name: Check result from previous step - run: if [ "${{ needs.lint.outputs.dht-node }}" != "true" ]; then exit 1; fi - - lint_dlt_connector: - name: Lint - DLT Connector - needs: lint - runs-on: ubuntu-latest - steps: - - name: Check result from previous step - run: if [ "${{ needs.lint.outputs.dlt-connector }}" != "true" ]; then exit 1; fi - - lint_federation: - name: Lint - Federation - needs: lint - runs-on: ubuntu-latest - steps: - - name: Check result from previous step - run: if [ "${{ needs.lint.outputs.federation }}" != "true" ]; then exit 1; fi \ No newline at end of file + echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT \ No newline at end of file diff --git a/.github/workflows/test_admin_interface.yml b/.github/workflows/test_admin_interface.yml index 5e66d56fa..f27220480 100644 --- a/.github/workflows/test_admin_interface.yml +++ b/.github/workflows/test_admin_interface.yml @@ -36,9 +36,9 @@ jobs: - name: Admin Interface | Build 'test' image run: docker build -f ./admin/Dockerfile --target production -t "gradido/admin:production" --build-arg NODE_ENV="production" --build-arg BUILD_COMMIT=$(git rev-parse HEAD) --build-arg BUILD_COMMIT_SHORT=$(git rev-parse --short HEAD) . - unit_test: + unit_test_lint: if: needs.files-changed.outputs.config == 'true' || needs.files-changed.outputs.admin == 'true' - name: Unit Tests - Admin Interface + name: Unit Tests & Lint & Stylelint & Locales - Admin Interface needs: files-changed runs-on: ubuntu-latest outputs: @@ -65,39 +65,4 @@ jobs: - name: Admin Interface | Unit tests id: test run: | - turbo admin#test admin#lint - echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT - - lint: - name: Lint - Admin Interface - needs: unit_test - runs-on: ubuntu-latest - steps: - - name: Check result from previous step - run: if [ "${{ needs.unit_test.outputs.test-success }}" != "true" ]; then exit 1; fi - - stylelint: - name: Stylelint - Admin Interface - needs: unit_test - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Check result from previous step - run: if [ "${{ needs.unit_test.outputs.test-success }}" != "true" ]; then exit 1; fi - - locales: - if: needs.files-changed.outputs.admin == 'true' - name: Locales - Admin Interface - needs: files-changed - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: install bun - uses: oven-sh/setup-bun@v2 - - - name: Admin Interface | Locales - run: cd admin && bun locales \ No newline at end of file + turbo admin#test admin#lint admin#locales \ No newline at end of file diff --git a/.github/workflows/test_backend.yml b/.github/workflows/test_backend.yml index 4098e8ae6..f4e2b822f 100644 --- a/.github/workflows/test_backend.yml +++ b/.github/workflows/test_backend.yml @@ -39,7 +39,7 @@ jobs: unit_test: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.docker-compose == 'true' || needs.files-changed.outputs.mariadb == 'true' || needs.files-changed.outputs.config == 'true' || needs.files-changed.outputs.core == 'true' || needs.files-changed.outputs.shared == 'true' - name: Unit tests - Backend + name: Unit tests & Typecheck & Build - Backend needs: files-changed runs-on: ubuntu-latest steps: @@ -65,31 +65,4 @@ jobs: bun install --global --no-save turbo@^2 - name: Backend | Unit tests - run: turbo backend#test - - typecheck: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.core == 'true' || needs.files-changed.outputs.shared == 'true' || needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.config == 'true' - name: Typecheck - Backend - needs: files-changed - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set Node.js version - uses: actions/setup-node@v4 - with: - node-version: '18.20.7' - - - name: install bun - uses: oven-sh/setup-bun@v2 - with: - bun-version-file: '.bun-version' - - - name: install dependencies - run: | - bun install --filter backend --frozen-lockfile - bun install --global --no-save turbo@^2 - - - name: Backend | Typecheck - run: turbo backend#typecheck backend#build \ No newline at end of file + run: turbo backend#test backend#typecheck backend#build \ No newline at end of file diff --git a/.github/workflows/test_config.yml b/.github/workflows/test_config.yml deleted file mode 100644 index 3a293d763..000000000 --- a/.github/workflows/test_config.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Gradido Config Schema Test CI - -on: push - -jobs: - files-changed: - name: Detect File Changes - Config-Schema - runs-on: ubuntu-latest - outputs: - config: ${{ steps.changes.outputs.config }} - docker-compose: ${{ steps.changes.outputs.docker-compose }} - steps: - - uses: actions/checkout@v3.3.0 - - - name: Check for config-schema file changes - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - token: ${{ github.token }} - filters: .github/file-filters.yml - list-files: shell - - build: - name: Unit Tests, typecheck - Config-Schema - if: needs.files-changed.outputs.config == 'true' || needs.files-changed.outputs.docker-compose == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: install bun - uses: oven-sh/setup-bun@v2 - with: - bun-version-file: '.bun-version' - - - name: install dependencies - run: bun install --filter config-schema --frozen-lockfile - - - name: typecheck - run: cd config-schema && bun run typecheck - - - name: unit tests - run: cd config-schema && bun run test - diff --git a/.github/workflows/test_database.yml b/.github/workflows/test_database.yml index 51bad45dc..d8a2cbdda 100644 --- a/.github/workflows/test_database.yml +++ b/.github/workflows/test_database.yml @@ -36,7 +36,7 @@ jobs: database_migration_test: if: needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.docker-compose == 'true' || needs.files-changed.outputs.mariadb == 'true' || needs.files-changed.outputs.shared == 'true' - name: Database Migration Test - Up + Reset + name: Database Migration Test & Build & Typecheck - Up + Reset needs: files-changed runs-on: ubuntu-latest steps: @@ -62,29 +62,7 @@ jobs: bun install --global --no-save turbo@^2 - name: Database | up + test - run: turbo database#test + run: turbo database#test database#build database#typecheck - name: Database | reset - run: turbo database#reset - - lint: - if: needs.files-changed.outputs.database == 'true' - name: Lint - Database Up - needs: files-changed - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: install bun - uses: oven-sh/setup-bun@v2 - with: - bun-version-file: '.bun-version' - - - name: install dependencies - run: | - bun install --filter database --frozen-lockfile - bun install --global turbo@^2 - - - name: Database | build & typecheck - run: turbo database#build database#typecheck \ No newline at end of file + run: turbo database#reset \ No newline at end of file diff --git a/.github/workflows/test_dht_node.yml b/.github/workflows/test_dht_node.yml index f2288f82c..6da96d2c7 100644 --- a/.github/workflows/test_dht_node.yml +++ b/.github/workflows/test_dht_node.yml @@ -35,7 +35,7 @@ jobs: run: docker build --target production -t "gradido/dht-node:production" -f dht-node/Dockerfile . unit_test: - name: Unit Tests - DHT Node + name: Unit Tests & Typecheck & Build - DHT Node if: needs.files-changed.outputs.config == 'true' || needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.dht_node == 'true' || needs.files-changed.outputs.docker-compose == 'true' needs: files-changed runs-on: ubuntu-latest diff --git a/.github/workflows/test_dlt_connector.yml b/.github/workflows/test_dlt_connector.yml index 791d92586..8c752e32b 100644 --- a/.github/workflows/test_dlt_connector.yml +++ b/.github/workflows/test_dlt_connector.yml @@ -44,7 +44,7 @@ jobs: run: docker build --target production -t "gradido/dlt-connector:productionTest" -f dlt-connector/Dockerfile . unit_test: - name: Unit Tests - DLT Connector + name: Unit Tests & Typecheck & Build - DLT Connector if: needs.files-changed.outputs.dlt_connector == 'true' || needs.files-changed.outputs.docker-compose == 'true' needs: [files-changed, build] runs-on: ubuntu-latest diff --git a/.github/workflows/test_federation.yml b/.github/workflows/test_federation.yml index b462151e7..5dbf76a3e 100644 --- a/.github/workflows/test_federation.yml +++ b/.github/workflows/test_federation.yml @@ -35,7 +35,7 @@ jobs: run: docker build --target production -t "gradido/federation:production" -f federation/Dockerfile . unit_test: - name: Unit Tests - Federation + name: Unit Tests & Typecheck & Build - Federation if: needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.docker-compose == 'true' || needs.files-changed.outputs.federation == 'true' || needs.files-changed.outputs.mariadb == 'true' needs: files-changed runs-on: ubuntu-latest diff --git a/.github/workflows/test_frontend.yml b/.github/workflows/test_frontend.yml index c3ae3732e..96343f643 100644 --- a/.github/workflows/test_frontend.yml +++ b/.github/workflows/test_frontend.yml @@ -38,7 +38,7 @@ jobs: unit_test: if: needs.files-changed.outputs.config == 'true' || needs.files-changed.outputs.frontend == 'true' - name: Unit Tests - Frontend + name: Unit Tests & Lint & Stylelint & Locales - Frontend needs: files-changed runs-on: ubuntu-latest steps: @@ -55,64 +55,11 @@ jobs: with: bun-version-file: '.bun-version' - - name: install dependencies - run: bun install --filter frontend --frozen-lockfile - - - name: Frontend | Unit tests - run: cd frontend && bun run test - - lint: - if: needs.files-changed.outputs.config == 'true' || needs.files-changed.outputs.frontend == 'true' - name: Lint - Frontend - needs: files-changed - runs-on: ubuntu-latest - outputs: - success: ${{ steps.lint.outputs.success }} - steps: - - name: Set Node.js version - uses: actions/setup-node@v4 - with: - node-version: '18.20.7' - - - name: Checkout code - uses: actions/checkout@v4 - - - name: install bun - uses: oven-sh/setup-bun@v2 - with: - bun-version-file: '.bun-version' - - name: install dependencies run: | bun install --filter frontend --frozen-lockfile bun install --global --no-save turbo@^2 - - name: Frontend | Lint - id: lint - run: | - turbo frontend#lint - echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT + - name: Frontend | Unit tests + run: turbo frontend#test frontend#lint frontend#locales - stylelint: - if: needs.files-changed.outputs.frontend == 'true' - name: Stylelint - Frontend - needs: [files-changed, lint] - runs-on: ubuntu-latest - steps: - - name: Check result from previous step - run: if [ "${{ needs.lint.outputs.success }}" != "true" ]; then exit 1; fi - - locales: - if: needs.files-changed.outputs.frontend == 'true' - name: Locales - Frontend - needs: files-changed - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: install bun - uses: oven-sh/setup-bun@v2 - - - name: Frontend | Locales - run: cd frontend && bun run locales diff --git a/.github/workflows/test_nginx.yml b/.github/workflows/test_nginx.yml deleted file mode 100644 index 146e7a117..000000000 --- a/.github/workflows/test_nginx.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Gradido Nginx Test CI - -on: push - -jobs: - files-changed: - name: Detect File Changes - Nginx - runs-on: ubuntu-latest - outputs: - nginx: ${{ steps.changes.outputs.nginx }} - steps: - - uses: actions/checkout@v3.3.0 - - - name: Check for nginx file changes - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - token: ${{ github.token }} - filters: .github/file-filters.yml - list-files: shell - - build_test_nginx: - name: Docker Build Test - Nginx - if: needs.files-changed.outputs.nginx == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: nginx | Build 'test' image - run: docker build -t "gradido/nginx:test" nginx/ diff --git a/.github/workflows/test_shared.yml b/.github/workflows/test_shared.yml deleted file mode 100644 index 7b4701b3e..000000000 --- a/.github/workflows/test_shared.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Gradido Shared Test CI - -on: push - -jobs: - files-changed: - name: Detect File Changes - Shared - runs-on: ubuntu-latest - outputs: - shared: ${{ steps.changes.outputs.shared }} - steps: - - uses: actions/checkout@v3.3.0 - - - name: Check for shared file changes - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - token: ${{ github.token }} - filters: .github/file-filters.yml - list-files: shell - - build: - name: Unit Tests, typecheck - Shared - if: needs.files-changed.outputs.shared == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: install bun - uses: oven-sh/setup-bun@v2 - with: - bun-version-file: '.bun-version' - - - name: install dependencies - run: bun install --filter shared --frozen-lockfile - - - name: typecheck - run: cd shared && bun run typecheck - - - name: unit tests - run: cd shared && bun run test - diff --git a/.github/workflows/test_core.yml b/.github/workflows/test_submodules.yml similarity index 61% rename from .github/workflows/test_core.yml rename to .github/workflows/test_submodules.yml index f3857e2ae..cbdfd16a2 100644 --- a/.github/workflows/test_core.yml +++ b/.github/workflows/test_submodules.yml @@ -1,15 +1,16 @@ -name: Gradido Core Test CI +name: Gradido Submodules Test CI on: push jobs: files-changed: - name: Detect File Changes - Core + name: Detect File Changes - Submodules runs-on: ubuntu-latest outputs: core: ${{ steps.changes.outputs.core }} database: ${{ steps.changes.outputs.database }} shared: ${{ steps.changes.outputs.shared }} + config: ${{ steps.changes.outputs.config }} steps: - uses: actions/checkout@v3.3.0 @@ -22,39 +23,27 @@ jobs: list-files: shell build: - name: Unit Tests, typecheck - Core - if: needs.files-changed.outputs.core == 'true' || needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.shared == 'true' + name: Unit Tests & Typecheck & Build - Submodules + if: needs.files-changed.outputs.core == 'true' || needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.shared == 'true' || needs.files-changed.outputs.config == 'true' needs: files-changed runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v5 - name: install bun uses: oven-sh/setup-bun@v2 with: bun-version-file: '.bun-version' + - name: Database & redis for tests using database and/or redis-semaphore + run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach mariadb redis + - name: install dependencies run: | bun install --filter core --frozen-lockfile bun install --global turbo@^2 - - name: typecheck && unit test - run: turbo core#test core#typecheck - - locales: - if: needs.files-changed.outputs.core == 'true' - name: Locales - Core - needs: files-changed - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: install bun - uses: oven-sh/setup-bun@v2 - - - name: Core | Locales - run: cd core && bun locales + - name: typecheck, locales && unit test + run: turbo core#test core#typecheck core#locales database#test database#typecheck shared#test shared#typecheck config-schema#test config-schema#typecheck diff --git a/bun.lock b/bun.lock index 2d192ec1f..4e45e053b 100644 --- a/bun.lock +++ b/bun.lock @@ -8,7 +8,6 @@ "auto-changelog": "^2.4.0", "cross-env": "^7.0.3", "jose": "^4.14.4", - "redis-semaphore": "^5.6.2", "turbo": "^2.5.0", "uuid": "^8.3.2", }, @@ -20,7 +19,7 @@ }, "admin": { "name": "admin", - "version": "2.7.2", + "version": "2.7.3", "dependencies": { "@iconify/json": "^2.2.228", "@popperjs/core": "^2.11.8", @@ -90,7 +89,7 @@ }, "backend": { "name": "backend", - "version": "2.7.2", + "version": "2.7.3", "dependencies": { "cross-env": "^7.0.3", "email-templates": "^10.0.1", @@ -166,7 +165,7 @@ }, "config-schema": { "name": "config-schema", - "version": "2.7.2", + "version": "2.7.3", "dependencies": { "esbuild": "^0.25.2", "joi": "17.13.3", @@ -184,7 +183,7 @@ }, "core": { "name": "core", - "version": "2.7.2", + "version": "2.7.3", "dependencies": { "database": "*", "email-templates": "^10.0.1", @@ -221,7 +220,7 @@ }, "database": { "name": "database", - "version": "2.7.2", + "version": "2.7.3", "dependencies": { "@types/uuid": "^8.3.4", "cross-env": "^7.0.3", @@ -255,7 +254,7 @@ }, "dht-node": { "name": "dht-node", - "version": "2.7.2", + "version": "2.7.3", "dependencies": { "cross-env": "^7.0.3", "dht-rpc": "6.18.1", @@ -293,7 +292,7 @@ }, "federation": { "name": "federation", - "version": "2.7.2", + "version": "2.7.3", "dependencies": { "cross-env": "^7.0.3", "email-templates": "^10.0.1", @@ -353,7 +352,7 @@ }, "frontend": { "name": "frontend", - "version": "2.7.2", + "version": "2.7.3", "dependencies": { "@morev/vue-transitions": "^3.0.2", "@types/leaflet": "^1.9.12", @@ -449,7 +448,7 @@ }, "shared": { "name": "shared", - "version": "2.7.2", + "version": "2.7.3", "dependencies": { "decimal.js-light": "^2.5.1", "esbuild": "^0.25.2",