Skip to content

feat: replace ArcadeDBException with InternalException for better err… #4589

feat: replace ArcadeDBException with InternalException for better err…

feat: replace ArcadeDBException with InternalException for better err… #4589

Workflow file for this run

name: Java CI - test
on:
workflow_dispatch:
pull_request:
branches:
- main
# Skip if only Python bindings change
paths-ignore:
- 'bindings/python/**'
push:
branches:
- main
# Skip if only Python bindings change
paths-ignore:
- 'bindings/python/**'
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Ensure SHA pinned actions
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@6124774845927d14c601359ab8138699fa5b70c3 # v4.0.1
- name: Run pre-commit
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: "3.13.0"
cache: "pip"
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
build-and-package:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up JDK 21
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 21
cache: "maven"
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Get project version
id: get-version
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
- name: Build and package with Maven Docker profile
run: ./mvnw clean install -Pdocker -DskipTests --batch-mode --errors --show-version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Save docker image
run: docker save arcadedata/arcadedb:latest > /tmp/arcadedb-image.tar
- name: Cache Docker image
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: /tmp/arcadedb-image.tar
key: docker-image-${{ github.run_id }}-${{ github.run_attempt }}
- name: Cache Maven artifacts
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ~/.m2/repository
key: maven-repo-${{ github.run_id }}-${{ github.run_attempt }}
unit-tests:
runs-on: ubuntu-latest
needs: build-and-package
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up JDK 21
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 21
cache: "maven"
- name: Restore Maven artifacts
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ~/.m2/repository
key: maven-repo-${{ github.run_id }}-${{ github.run_attempt }}
- name: Run Unit Tests with Coverage
# verify because it runs the tests and generates the coverage report, ITs are skipped
run: ./mvnw verify -Pcoverage --batch-mode --errors --fail-never --show-version -pl !e2e,!e2e-perf -DexcludedGroups=slow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Unit Tests Reporter
uses: dorny/test-reporter@fe45e9537387dac839af0d33ba56eed8e24189e8 # v2.3.0
if: success() || failure()
with:
name: Unit Tests Report
path: "**/surefire-reports/TEST*.xml"
list-suites: "failed"
list-tests: "failed"
reporter: java-junit
- name: Upload unit test coverage reports
if: success() || failure()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: unit-coverage-reports
path: |
**/jacoco*.xml
retention-days: 1
slow-unit-tests:
runs-on: ubuntu-latest
needs: build-and-package
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up JDK 21
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 21
cache: "maven"
- name: Restore Maven artifacts
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ~/.m2/repository
key: maven-repo-${{ github.run_id }}-${{ github.run_attempt }}
- name: Run Slow Unit Tests with Coverage
run: ./mvnw verify -Pcoverage --batch-mode --errors --fail-never --show-version -pl engine -Dgroups=slow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Unit Tests Reporter
uses: dorny/test-reporter@fe45e9537387dac839af0d33ba56eed8e24189e8 # v2.3.0
if: success() || failure()
with:
name: Unit Tests Report
path: "**/surefire-reports/TEST*.xml"
list-suites: "failed"
list-tests: "failed"
reporter: java-junit
- name: Upload unit test coverage reports
if: success() || failure()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: slow-unit-coverage-reports
path: |
**/jacoco*.xml
retention-days: 1
integration-tests:
runs-on: ubuntu-latest
needs: build-and-package
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up JDK 21
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 21
cache: "maven"
- name: Restore Maven artifacts
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ~/.m2/repository
key: maven-repo-${{ github.run_id }}-${{ github.run_attempt }}
- name: Run Integration Tests with Coverage
run: ./mvnw verify -DskipTests -Pintegration -Pcoverage --batch-mode --errors --fail-never --show-version -pl !e2e,!e2e-perf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: IT Tests Reporter
uses: dorny/test-reporter@fe45e9537387dac839af0d33ba56eed8e24189e8 # v2.3.0
if: success() || failure()
with:
name: IT Tests Report
path: "**/failsafe-reports/TEST*.xml"
list-suites: "failed"
list-tests: "failed"
reporter: java-junit
- name: Upload integration test coverage reports
if: success() || failure()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: integration-coverage-reports
path: |
**/jacoco*.xml
retention-days: 1
java-e2e-tests:
runs-on: ubuntu-latest
needs: build-and-package
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up JDK 21
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 21
cache: "maven"
- name: Restore Maven artifacts
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ~/.m2/repository
key: maven-repo-${{ github.run_id }}-${{ github.run_attempt }}
- name: Restore Docker image
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: /tmp/arcadedb-image.tar
key: docker-image-${{ github.run_id }}-${{ github.run_attempt }}
- name: Load Docker image
run: docker load < /tmp/arcadedb-image.tar
- name: E2E Tests
run: ./mvnw verify -pl e2e
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARCADEDB_DOCKER_IMAGE: ${{ needs.build-and-package.outputs.image-tag }}
- name: E2E Tests Reporter
uses: dorny/test-reporter@fe45e9537387dac839af0d33ba56eed8e24189e8 # v2.3.0
if: success() || failure()
with:
name: Java E2E Tests Report
path: "e2e/target/surefire-reports/TEST*.xml"
list-suites: "failed"
list-tests: "failed"
reporter: java-junit
java-e2e-perf-tests:
runs-on: ubuntu-latest
needs: build-and-package
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up JDK 21
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 21
cache: "maven"
- name: Restore Maven artifacts
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ~/.m2/repository
key: maven-repo-${{ github.run_id }}-${{ github.run_attempt }}
- name: Restore Docker image
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: /tmp/arcadedb-image.tar
key: docker-image-${{ github.run_id }}-${{ github.run_attempt }}
- name: Load Docker image
run: docker load < /tmp/arcadedb-image.tar
- name: E2E Perf Tests
run: ./mvnw verify -Pintegration -pl e2e-perf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARCADEDB_DOCKER_IMAGE: ${{ needs.build-and-package.outputs.image-tag }}
- name: E2E Perf Tests Reporter
uses: dorny/test-reporter@fe45e9537387dac839af0d33ba56eed8e24189e8 # v2.3.0
if: success() || failure()
with:
name: Java E2E Perf Tests Report
path: "e2e-perf/target/failsafe-reports/TEST*.xml"
list-suites: "failed"
list-tests: "failed"
reporter: java-junit
js-e2e-tests:
runs-on: ubuntu-latest
needs: build-and-package
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: "22"
cache: "npm"
cache-dependency-path: "e2e-js/package-lock.json"
- name: Restore Docker image
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: /tmp/arcadedb-image.tar
key: docker-image-${{ github.run_id }}-${{ github.run_attempt }}
- name: Load Docker image
run: docker load < /tmp/arcadedb-image.tar
- name: E2E Node.js Tests
working-directory: e2e-js
run: |
npm install
npm test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARCADEDB_DOCKER_IMAGE: ${{ needs.build-and-package.outputs.image-tag }}
studio-e2e-tests:
runs-on: ubuntu-latest
needs: build-and-package
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: "22"
cache: "npm"
cache-dependency-path: "e2e-studio/package-lock.json"
- name: Restore Docker image
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: /tmp/arcadedb-image.tar
key: docker-image-${{ github.run_id }}-${{ github.run_attempt }}
- name: Load Docker image
run: docker load < /tmp/arcadedb-image.tar
- name: Install Playwright Browsers
working-directory: e2e-studio
run: |
npm install
npm run install-browsers
- name: E2E Studio Tests
working-directory: e2e-studio
run: |
npm run test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARCADEDB_DOCKER_IMAGE: ${{ needs.build-and-package.outputs.image-tag }}
- name: Studio E2E Tests Reporter
uses: dorny/test-reporter@fe45e9537387dac839af0d33ba56eed8e24189e8 # v2.3.0
if: success() || failure()
with:
name: Studio E2E Tests Report
path: "e2e-studio/reports/playwright-junit.xml"
list-suites: "failed"
list-tests: "failed"
reporter: java-junit
- name: Upload Studio E2E test artifacts
if: success() || failure()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: studio-e2e-artifacts
path: |
e2e-studio/test-results/
e2e-studio/playwright-report/
retention-days: 7
python-e2e-tests:
runs-on: ubuntu-latest
needs: build-and-package
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: "3.13.0"
cache: "pip"
cache-dependency-path: "e2e-python/requirements*.txt"
- name: Setup UV package manager
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv --version
- name: Restore Docker image
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: /tmp/arcadedb-image.tar
key: docker-image-${{ github.run_id }}-${{ github.run_attempt }}
- name: Load Docker image
run: docker load < /tmp/arcadedb-image.tar
- name: E2E Python Tests
working-directory: e2e-python
run: |
uv pip install --system -e .
uv pip install --system pytest
pytest tests/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARCADEDB_DOCKER_IMAGE: ${{ needs.build-and-package.outputs.image-tag }}
coverage-report:
runs-on: ubuntu-latest
needs: [ unit-tests, integration-tests, slow-unit-tests ]
if: success() || failure()
steps:
- name: Download unit test coverage reports
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: unit-coverage-reports
path: unit-coverage
- name: Download unit test coverage reports
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: slow-unit-coverage-reports
path: slow-unit-coverage
- name: Download integration test coverage reports
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: integration-coverage-reports
path: integration-coverage
- name: Get coverage files
id: coverage-files-generator
if: success() || failure()
run: echo "COVERAGE_FILES=$(find . -path **/jacoco*.xml -printf '%p,')" >> "$GITHUB_OUTPUT"
- name: Codacy coverage reporter
uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 # v1.3.0
if: success() || failure()
with:
language: java
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ${{ steps.coverage-files-generator.outputs.COVERAGE_FILES }}