From 3f6b21b575c94399cdd44ee990b036ca83e1e94d Mon Sep 17 00:00:00 2001 From: joXemMx Date: Thu, 13 Nov 2025 22:16:45 +0100 Subject: [PATCH 01/14] try workflow structure that defaults to latest release but takes manual input --- .github/workflows/NewUpdate.yml | 322 +++++++++++++++++-------------- .github/workflows/PythonTest.yml | 230 ++++++++++++---------- .github/workflows/RTest.yml | 291 +++++++++++++++------------- .github/workflows/RunTests.yml | 21 +- 4 files changed, 480 insertions(+), 384 deletions(-) diff --git a/.github/workflows/NewUpdate.yml b/.github/workflows/NewUpdate.yml index 2a082fc8..a3502ff6 100644 --- a/.github/workflows/NewUpdate.yml +++ b/.github/workflows/NewUpdate.yml @@ -6,163 +6,187 @@ on: target_branch: type: string required: true - + sirius_version: + description: "Optional SIRIUS version to download (e.g. 6.3.3). Leave blank for latest." + type: string + required: false + jobs: UpdateClients: - # The type of runner that the job will run on runs-on: ubuntu-latest timeout-minutes: 90 - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Runs using the runners shell - - name: checkout repo - uses: actions/checkout@v3.1.0 - - name: Download latest generators - run: | - cd .updater/openapi_generator - wget -nv https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.10.0/openapi-generator-cli-7.10.0.jar -O openapi-generator-cli-7.10.jar - wget -nv https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar -O openapi-generator-cli-7.16.jar - - name: Download latest Sirius Release - uses: nick-fields/retry@v2 - with: - max_attempts: 5 - timeout_minutes: 5 - command: | + - name: checkout repo + uses: actions/checkout@v3.1.0 + - name: Download latest generators + run: | + cd .updater/openapi_generator + wget -nv https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.10.0/openapi-generator-cli-7.10.0.jar -O openapi-generator-cli-7.10.jar + wget -nv https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar -O openapi-generator-cli-7.16.jar + - name: Download SIRIUS Release + uses: nick-fields/retry@v2 + with: + max_attempts: 5 + timeout_minutes: 5 + command: | cd .updater/api - curl -s https://api.github.com/repositories/94561614/releases > ./releases.json - packageVersion=$(cat ./releases.json | grep 'name.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d - -f 2) - echo "Writing Version files: $packageVersion" - echo $packageVersion > ./packageVersion.txt - echo "Downloading Version: $packageVersion" - cat ./releases.json | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -nv -i - - echo "Download Complete" - unzip *.zip - echo "Api Ready" - - name: Run Rest Api with strings - run: | - bash .updater/api/sirius/bin/sirius REST --headless --api-mode=STABLE -p 8080 -s & - - name: Update api-docs-strings.json - run: | - while ! nc -z localhost 8080; do sleep 0.1; done - cd .updater/api - wget -nv http://localhost:8080/v3/api-docs -O api-docs-strings.json - - name: Shutdown SIRIUS - run: curl -X POST http://localhost:8080/actuator/shutdown - - name: Run Rest Api with enums - run: | - bash .updater/api/sirius/bin/sirius REST --headless --api-mode=STABLE --enums-as-ref -p 8080 -s & - - name: Update api-docs-enums.json - run: | - while ! nc -z localhost 8080; do sleep 0.1; done - cd .updater/api - wget -nv http://localhost:8080/v3/api-docs -O api-docs-enums.json - - name: Shutdown SIRIUS - run: curl -X POST http://localhost:8080/actuator/shutdown - - name: Update Clients - run: | - # load package version from file - packageVersion=$(cat .updater/api/packageVersion.txt) - - echo "generating Python Code with packageVersion=$packageVersion" - rm -rf client-api_python/generated/docs - rm -rf client-api_python/generated/PySirius - - java -jar .updater/openapi_generator/openapi-generator-cli-7.16.jar generate -i .updater/api/api-docs-enums.json -c .updater/config/Python/config.json -g python -o client-api_python/generated -t client-api_python/templates/python --additional-properties=packageVersion=$packageVersion - - echo "temporarily move R manual folder" - mv client-api_r/generated/man/ client-api_r/ - - echo "generating R Code with packageVersion=$packageVersion" - rm -rf client-api_r/generated/docs - rm -rf client-api_r/generated/R - - java -jar .updater/openapi_generator/openapi-generator-cli-7.10.jar generate -i .updater/api/api-docs-strings.json -c .updater/config/R/config.json -g r -o client-api_r/generated -t client-api_r/templates/r --additional-properties=packageVersion=$packageVersion - - echo "recover R manual folder" - mv client-api_r/man/ client-api_r/generated/ - - echo "generating Finished!" - - name: Format Python Package - run: | - cp client-api_python/pysirius_api.py client-api_python/generated/PySirius - cp client-api_python/pysirius_sdk.py client-api_python/generated/PySirius - cp client-api_python/pysirius_helper.py client-api_python/generated/PySirius - - chmod +x ./client-api_python/formatting/format_init.sh - ./client-api_python/formatting/format_init.sh - - name: Format R package - run: | - cp client-api_r/rsirius_sdk.R client-api_r/generated/R/rsirius_sdk.R - cp client-api_r/rsirius_helper.R client-api_r/generated/R/rsirius_helper.R - echo >> client-api_r/generated/NAMESPACE - echo "# SDK" >> client-api_r/generated/NAMESPACE - echo "export(SiriusSDK)" >> client-api_r/generated/NAMESPACE - echo "export(Helper)" >> client-api_r/generated/NAMESPACE - - chmod +x ./client-api_r/patches/list_syntax_fix.sh - ./client-api_r/patches/list_syntax_fix.sh - - chmod +x ./client-api_r/patches/insert_wait_for_job_completion_in_rsirius_api.sh - ./client-api_r/patches/insert_wait_for_job_completion_in_rsirius_api.sh - - name: Remove Sirius Rest Api - run: | - cd .updater/api - rm -rf *sirius* - rm -rf releases.json - echo "Done" - - name: Remove Openapi Generator Files - run: | - rm .updater/openapi_generator/*.jar - ls ./.github/workflows - echo "Done" - - name: update file and push to remote - uses: stefanzweifel/git-auto-commit-action@v4.15.2 - with: - commit_message: Auto-Updated OpenAPI Clients - - name: Run RManualGeneration - run: | - gh workflow run RManualGeneration.yml --ref ${GITHUB_REF##*/} - echo "dispatched workflow" - echo "sleeping for 30s to make sure it started" - sleep 30 - list=$(gh run list --workflow RManualGeneration --branch ${GITHUB_REF##*/}) - id=$(echo $list | grep -oP 'in_progress RManualGeneration RManualGeneration [^ ]* workflow_dispatch \K\d+') - echo "run ID of RManualGeneration is: $id" - gh run watch $id --exit-status --interval 3 - echo "generation done!" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: update file and create pull request - id: open-pr - uses: repo-sync/pull-request@v2 - with: + + if [ -n "${{ github.event.inputs.sirius_version }}" ]; then + # Manual version provided + version="${{ github.event.inputs.sirius_version }}" + echo "Using manually provided SIRIUS version: $version" + echo "$version" > ./packageVersion.txt + + url="https://github.com/sirius-ms/sirius/releases/download/v${version}/sirius-${version}-linux-x64.zip" + echo "Downloading from: $url" + wget -nv "$url" -O sirius-${version}-linux-x64.zip + else + # Fallback to automatic latest detection + echo "No version provided — fetching latest release..." + curl -s https://api.github.com/repos/sirius-ms/sirius/releases/latest > ./release.json + version=$(jq -r '.tag_name' ./release.json | sed 's/^v//') + echo "Latest version: $version" + echo "$version" > ./packageVersion.txt + + url=$(jq -r '.assets[] | select(.name | test("linux-x64.zip$")) | .browser_download_url' ./release.json) + echo "Downloading from: $url" + wget -nv "$url" -O sirius-${version}-linux-x64.zip + fi + + echo "Unzipping..." + unzip -q sirius-*-linux-x64.zip + echo "API Ready" + - name: Run Rest Api with strings + run: | + bash .updater/api/sirius/bin/sirius REST --headless --api-mode=STABLE -p 8080 -s & + - name: Update api-docs-strings.json + run: | + while ! nc -z localhost 8080; do sleep 0.1; done + cd .updater/api + wget -nv http://localhost:8080/v3/api-docs -O api-docs-strings.json + - name: Shutdown SIRIUS + run: curl -X POST http://localhost:8080/actuator/shutdown + - name: Run Rest Api with enums + run: | + bash .updater/api/sirius/bin/sirius REST --headless --api-mode=STABLE --enums-as-ref -p 8080 -s & + - name: Update api-docs-enums.json + run: | + while ! nc -z localhost 8080; do sleep 0.1; done + cd .updater/api + wget -nv http://localhost:8080/v3/api-docs -O api-docs-enums.json + - name: Shutdown SIRIUS + run: curl -X POST http://localhost:8080/actuator/shutdown + - name: Update Clients + run: | + # load package version from file + packageVersion=$(cat .updater/api/packageVersion.txt) + + echo "generating Python Code with packageVersion=$packageVersion" + rm -rf client-api_python/generated/docs + rm -rf client-api_python/generated/PySirius + + java -jar .updater/openapi_generator/openapi-generator-cli-7.16.jar generate -i .updater/api/api-docs-enums.json -c .updater/config/Python/config.json -g python -o client-api_python/generated -t client-api_python/templates/python --additional-properties=packageVersion=$packageVersion + + echo "temporarily move R manual folder" + mv client-api_r/generated/man/ client-api_r/ + + echo "generating R Code with packageVersion=$packageVersion" + rm -rf client-api_r/generated/docs + rm -rf client-api_r/generated/R + + java -jar .updater/openapi_generator/openapi-generator-cli-7.10.jar generate -i .updater/api/api-docs-strings.json -c .updater/config/R/config.json -g r -o client-api_r/generated -t client-api_r/templates/r --additional-properties=packageVersion=$packageVersion + + echo "recover R manual folder" + mv client-api_r/man/ client-api_r/generated/ + + echo "generating Finished!" + - name: Format Python Package + run: | + cp client-api_python/pysirius_api.py client-api_python/generated/PySirius + cp client-api_python/pysirius_sdk.py client-api_python/generated/PySirius + cp client-api_python/pysirius_helper.py client-api_python/generated/PySirius + + chmod +x ./client-api_python/formatting/format_init.sh + ./client-api_python/formatting/format_init.sh + - name: Format R package + run: | + cp client-api_r/rsirius_sdk.R client-api_r/generated/R/rsirius_sdk.R + cp client-api_r/rsirius_helper.R client-api_r/generated/R/rsirius_helper.R + echo >> client-api_r/generated/NAMESPACE + echo "# SDK" >> client-api_r/generated/NAMESPACE + echo "export(SiriusSDK)" >> client-api_r/generated/NAMESPACE + echo "export(Helper)" >> client-api_r/generated/NAMESPACE + + chmod +x ./client-api_r/patches/list_syntax_fix.sh + ./client-api_r/patches/list_syntax_fix.sh + + chmod +x ./client-api_r/patches/insert_wait_for_job_completion_in_rsirius_api.sh + ./client-api_r/patches/insert_wait_for_job_completion_in_rsirius_api.sh + - name: Remove Sirius Rest Api + run: | + cd .updater/api + rm -rf *sirius* + rm -rf releases.json + echo "Done" + - name: Remove Openapi Generator Files + run: | + rm .updater/openapi_generator/*.jar + ls ./.github/workflows + echo "Done" + - name: update file and push to remote + uses: stefanzweifel/git-auto-commit-action@v4.15.2 + with: + commit_message: Auto-Updated OpenAPI Clients + - name: Run RManualGeneration + run: | + gh workflow run RManualGeneration.yml --ref ${GITHUB_REF##*/} + echo "dispatched workflow" + echo "sleeping for 30s to make sure it started" + sleep 30 + list=$(gh run list --workflow RManualGeneration --branch ${GITHUB_REF##*/}) + id=$(echo $list | grep -oP 'in_progress RManualGeneration RManualGeneration [^ ]* workflow_dispatch \K\d+') + echo "run ID of RManualGeneration is: $id" + gh run watch $id --exit-status --interval 3 + echo "generation done!" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: update file and create pull request + id: open-pr + uses: repo-sync/pull-request@v2 + with: destination_branch: ${{ inputs.target_branch }} github_token: ${{ secrets.GITHUB_TOKEN }} pr_label: "Feature" pr_title: "AutoUpdated" pr_allow_empty: true - - name: check if request has been created - run: echo ${{steps.open-pr.outputs.pr_created}} - - name: lock pull request - continue-on-error: true - id: lockpull - uses: sudo-bot/action-pull-request-lock@v1.1.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - number: ${{steps.open-pr.outputs.pr_number}} - lock-reason: resolved - - name: Run tests if no changes occure - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# if: steps.lockpull.outcome == 'failure' - run: | - gh workflow run RunTests.yml --ref ${GITHUB_REF##*/} - echo "sleeping for 30min before temp branch removal" - sleep 1800 - - name: Delete temp branches if no changes occure - if: steps.lockpull.outcome == 'failure' - uses: dawidd6/action-delete-branch@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - prefix: temp_ - soft_fail: true + - name: check if request has been created + run: echo ${{steps.open-pr.outputs.pr_created}} + - name: lock pull request + continue-on-error: true + id: lockpull + uses: sudo-bot/action-pull-request-lock@v1.1.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + number: ${{steps.open-pr.outputs.pr_number}} + lock-reason: resolved + - name: Run tests if no changes occure + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + version=$(cat .updater/api/packageVersion.txt) + echo "Running RunTests workflow with SIRIUS version: $version" + gh workflow run RunTests.yml --ref ${GITHUB_REF##*/} -f sirius_version="$version" + echo "sleeping for 30min before temp branch removal" + sleep 1800 + # if: steps.lockpull.outcome == 'failure' + run: | + gh workflow run RunTests.yml --ref ${GITHUB_REF##*/} + echo "sleeping for 30min before temp branch removal" + sleep 1800 + - name: Delete temp branches if no changes occure + if: steps.lockpull.outcome == 'failure' + uses: dawidd6/action-delete-branch@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + prefix: temp_ + soft_fail: true diff --git a/.github/workflows/PythonTest.yml b/.github/workflows/PythonTest.yml index d37b5e2d..185eb03a 100644 --- a/.github/workflows/PythonTest.yml +++ b/.github/workflows/PythonTest.yml @@ -4,11 +4,20 @@ name: PythonTest -on: +on: workflow_dispatch: + inputs: + sirius_version: + description: "SIRIUS version to use for testing" + required: false + type: string workflow_call: + inputs: + sirius_version: + required: false + type: string pull_request: - + jobs: @@ -18,107 +27,124 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] env: SIRIUS_USER: ${{ secrets.SIRIUS_USER }} SIRIUS_PW: ${{ secrets.SIRIUS_PW }} steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - id: pysirius_install - run: | - python -m pip install --upgrade pip - python -m pip install flake8 - pip install ./client-api_python/generated - echo "Finished Installing" - - name: Cache Sirius Release - id: cache-sirius - uses: actions/cache@v3 - with: - path: .updater/api/sirius - key: sirius - fail-on-cache-miss: true - - name: Change HOME to working directory of runner - run: echo "HOME=/home/runner/work/sirius-client-openAPI" >> $GITHUB_ENV - - name: Download tomato_small project space - run: | - wget -nv ${{ secrets.TOMATO_SMALL_DOWNLOAD_LINK }} -O $HOME/tomato_small.sirius - chmod 666 $HOME/tomato_small.sirius - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 ./client-api_python --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 ./client-api_python --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Unset DISPLAY - run: echo "JAVA_TOOL_OPTIONS=-Djava.awt.headless=true" >> $GITHUB_ENV - - name: Check SIRIUS download - run: | - echo "Show content of cache download (.updater/api/)" - ls -lah .updater/api/ - echo "Show content of cache download (.updater/api/sirius)" - ls -lah .updater/api/sirius - echo "Show content of cache download (.updater/api/sirius/bin)" - ls -lah .updater/api/sirius/bin - - name: Run Rest Api - run: bash .updater/api/sirius/bin/sirius REST -p 8080 -s & - - name: Wait for Api to start - id: api_start - run: while ! nc -z localhost 8080; do sleep 0.1; done - - name: Login to SIRIUS - id: login - run: | - import os - import PySirius - accept_terms = True - account_credentials = PySirius.AccountCredentials(username=os.environ['SIRIUS_USER'], password=os.environ['SIRIUS_PW']) - api = PySirius.SiriusSDK().attach_to_sirius(sirius_port=8080) - api_instance = api.account() - api_response = api_instance.login(accept_terms, account_credentials) - if isinstance(api_response, PySirius.AccountInfo): - print('Login successful!') - exit(0) - else: - print('Login failed, aborting...') - exit(1) - shell: python - - name: Test actuator API - if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: python test_actuator_api.py - working-directory: client-api_python/generated/test - - name: Test info API - if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: python test_info_api.py - working-directory: client-api_python/generated/test - - name: Test login_and_account API - if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: python test_login_and_account_api.py - working-directory: client-api_python/generated/test - - name: Test projects API - if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: python test_projects_api.py - working-directory: client-api_python/generated/test - - name: Test compounds API - if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: python test_compounds_api.py - working-directory: client-api_python/generated/test - - name: Test searchable_databases API - if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: python test_searchable_databases_api.py - working-directory: client-api_python/generated/test - - name: Test features API - if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: python test_features_api.py - working-directory: client-api_python/generated/test - - name: Test jobs API - if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: python test_jobs_api.py - working-directory: client-api_python/generated/test - - name: Test acceptance - if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: python test_acceptance.py - working-directory: client-api_python/generated/test \ No newline at end of file + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + id: pysirius_install + run: | + python -m pip install --upgrade pip + python -m pip install flake8 + pip install ./client-api_python/generated + echo "Finished Installing" + - name: Determine SIRIUS version + id: sirius_version + run: | + if [ -n "${{ inputs.sirius_version }}" ]; then + echo "Using version from workflow input: ${{ inputs.sirius_version }}" + echo "version=${{ inputs.sirius_version }}" >> $GITHUB_OUTPUT + elif [ -f ".updater/api/packageVersion.txt" ]; then + version=$(cat .updater/api/packageVersion.txt) + echo "Using version from packageVersion.txt: $version" + echo "version=$version" >> $GITHUB_OUTPUT + else + echo "No version found — defaulting to latest." + version=$(curl -s https://api.github.com/repos/sirius-ms/sirius/releases/latest | jq -r '.tag_name' | sed 's/^v//') + echo "version=$version" >> $GITHUB_OUTPUT + fi + - name: Download SIRIUS + run: | + version="${{ steps.sirius_version.outputs.version }}" + mkdir -p .updater/api + cd .updater/api + url="https://github.com/sirius-ms/sirius/releases/download/v${version}/sirius-${version}-linux-x64.zip" + echo "Downloading $url" + wget -nv "$url" -O sirius-${version}-linux-x64.zip + unzip -q sirius-${version}-linux-x64.zip + - name: Change HOME to working directory of runner + run: echo "HOME=/home/runner/work/sirius-client-openAPI" >> $GITHUB_ENV + - name: Download tomato_small project space + run: | + wget -nv ${{ secrets.TOMATO_SMALL_DOWNLOAD_LINK }} -O $HOME/tomato_small.sirius + chmod 666 $HOME/tomato_small.sirius + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 ./client-api_python --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 ./client-api_python --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Unset DISPLAY + run: echo "JAVA_TOOL_OPTIONS=-Djava.awt.headless=true" >> $GITHUB_ENV + - name: Check SIRIUS download + run: | + echo "Show content of cache download (.updater/api/)" + ls -lah .updater/api/ + echo "Show content of cache download (.updater/api/sirius)" + ls -lah .updater/api/sirius + echo "Show content of cache download (.updater/api/sirius/bin)" + ls -lah .updater/api/sirius/bin + - name: Run Rest Api + run: bash .updater/api/sirius/bin/sirius REST -p 8080 -s & + - name: Wait for Api to start + id: api_start + run: while ! nc -z localhost 8080; do sleep 0.1; done + - name: Login to SIRIUS + id: login + run: | + import os + import PySirius + accept_terms = True + account_credentials = PySirius.AccountCredentials(username=os.environ['SIRIUS_USER'], password=os.environ['SIRIUS_PW']) + api = PySirius.SiriusSDK().attach_to_sirius(sirius_port=8080) + api_instance = api.account() + api_response = api_instance.login(accept_terms, account_credentials) + if isinstance(api_response, PySirius.AccountInfo): + print('Login successful!') + exit(0) + else: + print('Login failed, aborting...') + exit(1) + shell: python + - name: Test actuator API + if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: python test_actuator_api.py + working-directory: client-api_python/generated/test + - name: Test info API + if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: python test_info_api.py + working-directory: client-api_python/generated/test + - name: Test login_and_account API + if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: python test_login_and_account_api.py + working-directory: client-api_python/generated/test + - name: Test projects API + if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: python test_projects_api.py + working-directory: client-api_python/generated/test + - name: Test compounds API + if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: python test_compounds_api.py + working-directory: client-api_python/generated/test + - name: Test searchable_databases API + if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: python test_searchable_databases_api.py + working-directory: client-api_python/generated/test + - name: Test features API + if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: python test_features_api.py + working-directory: client-api_python/generated/test + - name: Test jobs API + if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: python test_jobs_api.py + working-directory: client-api_python/generated/test + - name: Test acceptance + if: always() && steps.api_start.outcome == 'success' && steps.pysirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: python test_acceptance.py + working-directory: client-api_python/generated/test \ No newline at end of file diff --git a/.github/workflows/RTest.yml b/.github/workflows/RTest.yml index 4383b2ff..2f5c0d1e 100644 --- a/.github/workflows/RTest.yml +++ b/.github/workflows/RTest.yml @@ -4,7 +4,20 @@ name: RTest -on: [workflow_dispatch, workflow_call, pull_request] +on: + workflow_dispatch: + inputs: + sirius_version: + description: "SIRIUS version to use for testing" + required: false + type: string + workflow_call: + inputs: + sirius_version: + required: false + type: string + pull_request: + jobs: @@ -14,136 +27,154 @@ jobs: strategy: fail-fast: false matrix: - r-version: ["4.1", "4.2", "4.3", "4.4", "4.5"] + r-version: [ "4.1", "4.2", "4.3", "4.4", "4.5" ] env: SIRIUS_USER: ${{ secrets.SIRIUS_USER }} SIRIUS_PW: ${{ secrets.SIRIUS_PW }} steps: - - uses: actions/checkout@v3 - - name: Set up R ${{ matrix.r-version }} - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.r-version }} - - name: Install RSirius dependencies - uses: r-lib/actions/setup-r-dependencies@v2 - with: - cache: false - working-directory: ./client-api_r/generated - - name: Install RSirius - id: rsirius_install - run: | - install.packages("/home/runner/work/sirius-client-openAPI/sirius-client-openAPI/client-api_r/generated", repos = NULL, type = "source") - shell: Rscript {0} - - name: Cache Sirius Release - uses: actions/cache@v3 - with: - path: .updater/api/sirius - key: sirius - fail-on-cache-miss: true - - name: Change HOME to working directory of runner - run: echo "HOME=/home/runner/work/sirius-client-openAPI" >> $GITHUB_ENV - - name: Download tomato_small project space - run: | - wget -nv ${{ secrets.TOMATO_SMALL_DOWNLOAD_LINK }} -O $HOME/tomato_small.sirius - chmod 666 $HOME/tomato_small.sirius - - name: Check SIRIUS download - run: | - echo "Show content of cache download (.updater/api/)" - ls -lah .updater/api/ - echo "Show content of cache download (.updater/api/sirius)" - ls -lah .updater/api/sirius - echo "Show content of cache download (.updater/api/sirius/bin)" - ls -lah .updater/api/sirius/bin - - name: Run Rest Api - run: bash .updater/api/sirius/bin/sirius REST -p 8080 -s & - - name: Wait for Api to start - id: api_start - run: while ! nc -z localhost 8080; do sleep 0.1; done - - name: Login to SIRIUS - id: login - run: | - library(RSirius) - var_accept_terms <- TRUE - var_account_credentials <- AccountCredentials$new(Sys.getenv('SIRIUS_USER'), Sys.getenv('SIRIUS_PW')) - api_instance <- rsirius_api$new() - api_response <- api_instance$login_and_account_api$Login(var_accept_terms, var_account_credentials) - if (inherits(api_response, "AccountInfo")) { - print('Login successful!') - quit(status=0) - } else { - print('Login failed, aborting...') - quit(status=1) - } - shell: Rscript {0} - - name: Test Actuator API - if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: | - library(RSirius) - library(testthat) - multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) - test_file("client-api_r/generated/tests/testthat/test_actuator_api.R", reporter=multi_reporter) - shell: Rscript {0} - - name: Test Info API - if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: | - library(RSirius) - library(testthat) - multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) - test_file("client-api_r/generated/tests/testthat/test_info_api.R", reporter=multi_reporter) - shell: Rscript {0} - - name: Test Login and Account API - if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: | - library(RSirius) - library(testthat) - multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) - test_file("client-api_r/generated/tests/testthat/test_login_and_account_api.R", reporter=multi_reporter) - shell: Rscript {0} - - name: Test Projects API - if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: | - library(RSirius) - library(testthat) - multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) - test_file("client-api_r/generated/tests/testthat/test_projects_api.R", reporter=multi_reporter) - shell: Rscript {0} - - name: Test Compounds API - if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: | - library(RSirius) - library(testthat) - multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) - test_file("client-api_r/generated/tests/testthat/test_compounds_api.R", reporter=multi_reporter) - shell: Rscript {0} - - name: Test Databases API - if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: | - library(RSirius) - library(testthat) - multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) - test_file("client-api_r/generated/tests/testthat/test_searchable_databases_api.R", reporter=multi_reporter) - shell: Rscript {0} - - name: Test Features API - if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: | - library(RSirius) - library(testthat) - multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) - test_file("client-api_r/generated/tests/testthat/test_features_api.R", reporter=multi_reporter) - shell: Rscript {0} - - name: Test Jobs API - if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: | - library(RSirius) - library(testthat) - multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) - test_file("client-api_r/generated/tests/testthat/test_jobs_api.R", reporter=multi_reporter) - shell: Rscript {0} - - name: Test acceptance - if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' - run: | - library(RSirius) - library(testthat) - multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) - test_file("client-api_r/generated/tests/testthat/test_acceptance.R", reporter=multi_reporter) - shell: Rscript {0} \ No newline at end of file + - uses: actions/checkout@v3 + - name: Set up R ${{ matrix.r-version }} + uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.r-version }} + - name: Install RSirius dependencies + uses: r-lib/actions/setup-r-dependencies@v2 + with: + cache: false + working-directory: ./client-api_r/generated + - name: Install RSirius + id: rsirius_install + run: | + install.packages("/home/runner/work/sirius-client-openAPI/sirius-client-openAPI/client-api_r/generated", repos = NULL, type = "source") + shell: Rscript {0} + - name: Determine SIRIUS version + id: sirius_version + run: | + if [ -n "${{ inputs.sirius_version }}" ]; then + echo "Using version from workflow input: ${{ inputs.sirius_version }}" + echo "version=${{ inputs.sirius_version }}" >> $GITHUB_OUTPUT + elif [ -f ".updater/api/packageVersion.txt" ]; then + version=$(cat .updater/api/packageVersion.txt) + echo "Using version from packageVersion.txt: $version" + echo "version=$version" >> $GITHUB_OUTPUT + else + echo "No version found — defaulting to latest." + version=$(curl -s https://api.github.com/repos/sirius-ms/sirius/releases/latest | jq -r '.tag_name' | sed 's/^v//') + echo "version=$version" >> $GITHUB_OUTPUT + fi + - name: Download SIRIUS + run: | + version="${{ steps.sirius_version.outputs.version }}" + mkdir -p .updater/api + cd .updater/api + url="https://github.com/sirius-ms/sirius/releases/download/v${version}/sirius-${version}-linux-x64.zip" + echo "Downloading $url" + wget -nv "$url" -O sirius-${version}-linux-x64.zip + unzip -q sirius-${version}-linux-x64.zip + - name: Change HOME to working directory of runner + run: echo "HOME=/home/runner/work/sirius-client-openAPI" >> $GITHUB_ENV + - name: Download tomato_small project space + run: | + wget -nv ${{ secrets.TOMATO_SMALL_DOWNLOAD_LINK }} -O $HOME/tomato_small.sirius + chmod 666 $HOME/tomato_small.sirius + - name: Check SIRIUS download + run: | + echo "Show content of cache download (.updater/api/)" + ls -lah .updater/api/ + echo "Show content of cache download (.updater/api/sirius)" + ls -lah .updater/api/sirius + echo "Show content of cache download (.updater/api/sirius/bin)" + ls -lah .updater/api/sirius/bin + - name: Run Rest Api + run: bash .updater/api/sirius/bin/sirius REST -p 8080 -s & + - name: Wait for Api to start + id: api_start + run: while ! nc -z localhost 8080; do sleep 0.1; done + - name: Login to SIRIUS + id: login + run: | + library(RSirius) + var_accept_terms <- TRUE + var_account_credentials <- AccountCredentials$new(Sys.getenv('SIRIUS_USER'), Sys.getenv('SIRIUS_PW')) + api_instance <- rsirius_api$new() + api_response <- api_instance$login_and_account_api$Login(var_accept_terms, var_account_credentials) + if (inherits(api_response, "AccountInfo")) { + print('Login successful!') + quit(status=0) + } else { + print('Login failed, aborting...') + quit(status=1) + } + shell: Rscript {0} + - name: Test Actuator API + if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: | + library(RSirius) + library(testthat) + multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) + test_file("client-api_r/generated/tests/testthat/test_actuator_api.R", reporter=multi_reporter) + shell: Rscript {0} + - name: Test Info API + if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: | + library(RSirius) + library(testthat) + multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) + test_file("client-api_r/generated/tests/testthat/test_info_api.R", reporter=multi_reporter) + shell: Rscript {0} + - name: Test Login and Account API + if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: | + library(RSirius) + library(testthat) + multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) + test_file("client-api_r/generated/tests/testthat/test_login_and_account_api.R", reporter=multi_reporter) + shell: Rscript {0} + - name: Test Projects API + if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: | + library(RSirius) + library(testthat) + multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) + test_file("client-api_r/generated/tests/testthat/test_projects_api.R", reporter=multi_reporter) + shell: Rscript {0} + - name: Test Compounds API + if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: | + library(RSirius) + library(testthat) + multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) + test_file("client-api_r/generated/tests/testthat/test_compounds_api.R", reporter=multi_reporter) + shell: Rscript {0} + - name: Test Databases API + if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: | + library(RSirius) + library(testthat) + multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) + test_file("client-api_r/generated/tests/testthat/test_searchable_databases_api.R", reporter=multi_reporter) + shell: Rscript {0} + - name: Test Features API + if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: | + library(RSirius) + library(testthat) + multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) + test_file("client-api_r/generated/tests/testthat/test_features_api.R", reporter=multi_reporter) + shell: Rscript {0} + - name: Test Jobs API + if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: | + library(RSirius) + library(testthat) + multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) + test_file("client-api_r/generated/tests/testthat/test_jobs_api.R", reporter=multi_reporter) + shell: Rscript {0} + - name: Test acceptance + if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success' + run: | + library(RSirius) + library(testthat) + multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new())) + test_file("client-api_r/generated/tests/testthat/test_acceptance.R", reporter=multi_reporter) + shell: Rscript {0} \ No newline at end of file diff --git a/.github/workflows/RunTests.yml b/.github/workflows/RunTests.yml index 44d801da..0f378d31 100644 --- a/.github/workflows/RunTests.yml +++ b/.github/workflows/RunTests.yml @@ -1,13 +1,28 @@ -# This workflow will start all individual Tests - name: RunTests -on: [workflow_dispatch, workflow_call, pull_request] +on: + workflow_dispatch: + inputs: + sirius_version: + description: "SIRIUS version to test (passed from NewUpdate)" + required: false + type: string + workflow_call: + inputs: + sirius_version: + required: false + type: string + pull_request: jobs: RTest: uses: ./.github/workflows/RTest.yml secrets: inherit + with: + sirius_version: ${{ inputs.sirius_version }} + PythonTest: uses: ./.github/workflows/PythonTest.yml secrets: inherit + with: + sirius_version: ${{ inputs.sirius_version }} From 6de5e7155b7aeffc74a161cffbeebac2474965da Mon Sep 17 00:00:00 2001 From: joXemMx Date: Thu, 13 Nov 2025 22:28:48 +0100 Subject: [PATCH 02/14] forgot ClientUpdater and SetupBranch --- .github/workflows/SetupBranch.yml | 34 +++++++++++++++++------------- .github/workflows/updater.yml | 35 ++++++++++++++----------------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/.github/workflows/SetupBranch.yml b/.github/workflows/SetupBranch.yml index 4c6cf3f5..66a2e105 100644 --- a/.github/workflows/SetupBranch.yml +++ b/.github/workflows/SetupBranch.yml @@ -1,33 +1,39 @@ - name: SetupBranch -# Controls when the action will run. Workflow runs when manually triggered using the UI -# or API. on: workflow_dispatch: inputs: target_branch: type: string required: true - - + sirius_version: + description: "Optional: specify SIRIUS version to use (e.g. 6.3.3)" + required: false + type: string + jobs: CreateTempBranch: runs-on: ubuntu-latest steps: - - name: Create Branch - uses: peterjgrainger/action-create-branch@v2.2.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - branch: ${{ inputs.target_branch }} + - name: Create Branch + uses: peterjgrainger/action-create-branch@v2.2.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + branch: ${{ inputs.target_branch }} + UpdateOnNewBranch: needs: CreateTempBranch runs-on: ubuntu-latest steps: - name: checkout repo - uses: actions/checkout@v3.1.0 - - name: Call Workflow - run: gh workflow run NewUpdate.yml --ref ${{ inputs.target_branch }} -f target_branch=${GITHUB_REF##*/} + uses: actions/checkout@v3 + - name: Call NewUpdate + run: | + version_input="" + if [ -n "${{ inputs.sirius_version }}" ]; then + version_input="-f sirius_version=${{ inputs.sirius_version }}" + fi + gh workflow run NewUpdate.yml --ref ${{ inputs.target_branch }} -f target_branch=${GITHUB_REF##*/} $version_input env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index e70438eb..c2445206 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -1,32 +1,29 @@ -# This is a basic workflow that is manually triggered - name: Client_Updater -# Controls when the action will run. Workflow runs when manually triggered using the UI -# or API. on: - [workflow_dispatch, repository_dispatch] - # Inputs the workflow accepts. -# inputs: - # name: - # # Friendly description to be shown in the UI instead of 'name' - # description: 'Person to greet' - # # Default value if no value is explicitly provided - ## default: 'World' - # # Input has to be provided for the workflow to run - #required: true + workflow_dispatch: + inputs: + sirius_version: + description: "Optional: specify SIRIUS version to use (e.g. 6.3.3)" + required: false + type: string + repository_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # does not run on the temp branch itself UpdateCache: uses: ./.github/workflows/update-api.yml + UpdateOnNewBranch: runs-on: ubuntu-latest steps: - name: checkout repo - uses: actions/checkout@v3.1.0 - - name: Call Workflow - run: gh workflow run SetupBranch.yml --ref ${GITHUB_REF##*/} -f target_branch=$(echo -en temp_;date +"%Y%m%d%H%M%S%N") + uses: actions/checkout@v3 + - name: Call SetupBranch + run: | + version_input="" + if [ -n "${{ inputs.sirius_version }}" ]; then + version_input="-f sirius_version=${{ inputs.sirius_version }}" + fi + gh workflow run SetupBranch.yml --ref ${GITHUB_REF##*/} -f target_branch=$(echo -en temp_;date +"%Y%m%d%H%M%S%N") $version_input env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1c837cb1090625931517b3faf17b470446cf373b Mon Sep 17 00:00:00 2001 From: joXemMx Date: Thu, 13 Nov 2025 22:31:28 +0100 Subject: [PATCH 03/14] remove cache update --- .github/workflows/updater.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index c2445206..82d7df05 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -10,9 +10,6 @@ on: repository_dispatch: jobs: - UpdateCache: - uses: ./.github/workflows/update-api.yml - UpdateOnNewBranch: runs-on: ubuntu-latest steps: From 0043c50e23b6e05bc7ff9c223a656b8cd1248ec0 Mon Sep 17 00:00:00 2001 From: joXemMx Date: Thu, 13 Nov 2025 22:45:26 +0100 Subject: [PATCH 04/14] add descriptions --- .github/workflows/NewUpdate.yml | 1 + .github/workflows/SetupBranch.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/NewUpdate.yml b/.github/workflows/NewUpdate.yml index a3502ff6..bab79561 100644 --- a/.github/workflows/NewUpdate.yml +++ b/.github/workflows/NewUpdate.yml @@ -6,6 +6,7 @@ on: target_branch: type: string required: true + description: "Target branch to put update commits on." sirius_version: description: "Optional SIRIUS version to download (e.g. 6.3.3). Leave blank for latest." type: string diff --git a/.github/workflows/SetupBranch.yml b/.github/workflows/SetupBranch.yml index 66a2e105..1d55432b 100644 --- a/.github/workflows/SetupBranch.yml +++ b/.github/workflows/SetupBranch.yml @@ -6,6 +6,7 @@ on: target_branch: type: string required: true + description: "Temporary branch to create (NewUpdate will commit to that branch)." sirius_version: description: "Optional: specify SIRIUS version to use (e.g. 6.3.3)" required: false From 7204341218f7551370539e5540a679511c8b56d8 Mon Sep 17 00:00:00 2001 From: joXemMx Date: Thu, 13 Nov 2025 22:47:32 +0100 Subject: [PATCH 05/14] remove duplicate run --- .github/workflows/NewUpdate.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/NewUpdate.yml b/.github/workflows/NewUpdate.yml index bab79561..d1550ea1 100644 --- a/.github/workflows/NewUpdate.yml +++ b/.github/workflows/NewUpdate.yml @@ -180,10 +180,6 @@ jobs: echo "sleeping for 30min before temp branch removal" sleep 1800 # if: steps.lockpull.outcome == 'failure' - run: | - gh workflow run RunTests.yml --ref ${GITHUB_REF##*/} - echo "sleeping for 30min before temp branch removal" - sleep 1800 - name: Delete temp branches if no changes occure if: steps.lockpull.outcome == 'failure' uses: dawidd6/action-delete-branch@v3 From 51153d425bf65a8250786e3b50672ccc9cdda015 Mon Sep 17 00:00:00 2001 From: joXemMx Date: Thu, 13 Nov 2025 22:54:13 +0100 Subject: [PATCH 06/14] openapi_generator directory handling --- .github/workflows/NewUpdate.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/NewUpdate.yml b/.github/workflows/NewUpdate.yml index d1550ea1..af309ccd 100644 --- a/.github/workflows/NewUpdate.yml +++ b/.github/workflows/NewUpdate.yml @@ -21,6 +21,7 @@ jobs: uses: actions/checkout@v3.1.0 - name: Download latest generators run: | + mkdir .updater/openapi_generator cd .updater/openapi_generator wget -nv https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.10.0/openapi-generator-cli-7.10.0.jar -O openapi-generator-cli-7.10.jar wget -nv https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar -O openapi-generator-cli-7.16.jar @@ -131,7 +132,7 @@ jobs: echo "Done" - name: Remove Openapi Generator Files run: | - rm .updater/openapi_generator/*.jar + rm -rf .updater/openapi_generator ls ./.github/workflows echo "Done" - name: update file and push to remote From b313437bfa4113df142a680fd31a8a6d872c6ae5 Mon Sep 17 00:00:00 2001 From: joXemMx Date: Thu, 13 Nov 2025 23:38:04 +0100 Subject: [PATCH 07/14] delete release json in workflow --- .github/workflows/NewUpdate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/NewUpdate.yml b/.github/workflows/NewUpdate.yml index af309ccd..747cb47c 100644 --- a/.github/workflows/NewUpdate.yml +++ b/.github/workflows/NewUpdate.yml @@ -47,6 +47,7 @@ jobs: echo "No version provided — fetching latest release..." curl -s https://api.github.com/repos/sirius-ms/sirius/releases/latest > ./release.json version=$(jq -r '.tag_name' ./release.json | sed 's/^v//') + rm ./release.json echo "Latest version: $version" echo "$version" > ./packageVersion.txt From ceea0b8b23d9c0fec432c3bd79b372e2f9b73f1d Mon Sep 17 00:00:00 2001 From: joXemMx Date: Thu, 13 Nov 2025 23:41:48 +0100 Subject: [PATCH 08/14] clean up version fetch --- .github/workflows/NewUpdate.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/NewUpdate.yml b/.github/workflows/NewUpdate.yml index 747cb47c..2399525d 100644 --- a/.github/workflows/NewUpdate.yml +++ b/.github/workflows/NewUpdate.yml @@ -45,9 +45,7 @@ jobs: else # Fallback to automatic latest detection echo "No version provided — fetching latest release..." - curl -s https://api.github.com/repos/sirius-ms/sirius/releases/latest > ./release.json - version=$(jq -r '.tag_name' ./release.json | sed 's/^v//') - rm ./release.json + version=$(curl -s https://api.github.com/repos/sirius-ms/sirius/releases/latest | jq -r '.tag_name' | sed 's/^v//') echo "Latest version: $version" echo "$version" > ./packageVersion.txt From 5eae02917dc64719da2852c40cfa288c0568cc1b Mon Sep 17 00:00:00 2001 From: joXemMx Date: Thu, 13 Nov 2025 23:47:31 +0100 Subject: [PATCH 09/14] fix url for latest version fetch --- .github/workflows/NewUpdate.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/NewUpdate.yml b/.github/workflows/NewUpdate.yml index 2399525d..ed6eb63b 100644 --- a/.github/workflows/NewUpdate.yml +++ b/.github/workflows/NewUpdate.yml @@ -36,24 +36,19 @@ jobs: if [ -n "${{ github.event.inputs.sirius_version }}" ]; then # Manual version provided version="${{ github.event.inputs.sirius_version }}" - echo "Using manually provided SIRIUS version: $version" - echo "$version" > ./packageVersion.txt - - url="https://github.com/sirius-ms/sirius/releases/download/v${version}/sirius-${version}-linux-x64.zip" - echo "Downloading from: $url" - wget -nv "$url" -O sirius-${version}-linux-x64.zip + echo "Using manually provided SIRIUS version: $version" else # Fallback to automatic latest detection echo "No version provided — fetching latest release..." version=$(curl -s https://api.github.com/repos/sirius-ms/sirius/releases/latest | jq -r '.tag_name' | sed 's/^v//') echo "Latest version: $version" - echo "$version" > ./packageVersion.txt - - url=$(jq -r '.assets[] | select(.name | test("linux-x64.zip$")) | .browser_download_url' ./release.json) - echo "Downloading from: $url" - wget -nv "$url" -O sirius-${version}-linux-x64.zip fi + echo "$version" > ./packageVersion.txt + url="https://github.com/sirius-ms/sirius/releases/download/v${version}/sirius-${version}-linux-x64.zip" + echo "Downloading from: $url" + wget -nv "$url" -O sirius-${version}-linux-x64.zip + echo "Unzipping..." unzip -q sirius-*-linux-x64.zip echo "API Ready" From 8d19ae36fb5ead9c544589ec5e201cb62b6af6b9 Mon Sep 17 00:00:00 2001 From: joXemMx Date: Thu, 13 Nov 2025 23:49:49 +0100 Subject: [PATCH 10/14] use $GITHUB_OUTPUT --- .github/workflows/SetupBranch.yml | 14 ++++++++++---- .github/workflows/updater.yml | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/SetupBranch.yml b/.github/workflows/SetupBranch.yml index 1d55432b..49c852a3 100644 --- a/.github/workflows/SetupBranch.yml +++ b/.github/workflows/SetupBranch.yml @@ -15,6 +15,8 @@ on: jobs: CreateTempBranch: runs-on: ubuntu-latest + outputs: + target_branch: ${{ steps.output.outputs.target_branch }} steps: - name: Create Branch uses: peterjgrainger/action-create-branch@v2.2.0 @@ -22,6 +24,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: branch: ${{ inputs.target_branch }} + - name: Set output + id: output + run: | + echo "target_branch=${{ inputs.target_branch }}" >> $GITHUB_OUTPUT UpdateOnNewBranch: needs: CreateTempBranch @@ -31,10 +37,10 @@ jobs: uses: actions/checkout@v3 - name: Call NewUpdate run: | - version_input="" if [ -n "${{ inputs.sirius_version }}" ]; then - version_input="-f sirius_version=${{ inputs.sirius_version }}" + gh workflow run NewUpdate.yml --ref ${{ inputs.target_branch }} -f target_branch=${GITHUB_REF##*/} -f sirius_version=${{ inputs.sirius_version }} + else + gh workflow run NewUpdate.yml --ref ${{ inputs.target_branch }} -f target_branch=${GITHUB_REF##*/} fi - gh workflow run NewUpdate.yml --ref ${{ inputs.target_branch }} -f target_branch=${GITHUB_REF##*/} $version_input env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index 82d7df05..9fc58c45 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -12,15 +12,21 @@ on: jobs: UpdateOnNewBranch: runs-on: ubuntu-latest + outputs: + target_branch: ${{ steps.setup.outputs.target_branch }} steps: - name: checkout repo uses: actions/checkout@v3 - name: Call SetupBranch + id: setup run: | - version_input="" + target_branch=$(echo -en temp_;date +"%Y%m%d%H%M%S%N") + echo "target_branch=$target_branch" >> $GITHUB_OUTPUT + if [ -n "${{ inputs.sirius_version }}" ]; then - version_input="-f sirius_version=${{ inputs.sirius_version }}" + gh workflow run SetupBranch.yml --ref ${GITHUB_REF##*/} -f target_branch=$target_branch -f sirius_version=${{ inputs.sirius_version }} + else + gh workflow run SetupBranch.yml --ref ${GITHUB_REF##*/} -f target_branch=$target_branch fi - gh workflow run SetupBranch.yml --ref ${GITHUB_REF##*/} -f target_branch=$(echo -en temp_;date +"%Y%m%d%H%M%S%N") $version_input env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 5474d35db6f7708558ba96c86198618739d53b6e Mon Sep 17 00:00:00 2001 From: joXemMx Date: Thu, 13 Nov 2025 23:58:27 +0100 Subject: [PATCH 11/14] small cleanup --- .github/workflows/SetupBranch.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/SetupBranch.yml b/.github/workflows/SetupBranch.yml index 49c852a3..1967270a 100644 --- a/.github/workflows/SetupBranch.yml +++ b/.github/workflows/SetupBranch.yml @@ -15,8 +15,6 @@ on: jobs: CreateTempBranch: runs-on: ubuntu-latest - outputs: - target_branch: ${{ steps.output.outputs.target_branch }} steps: - name: Create Branch uses: peterjgrainger/action-create-branch@v2.2.0 @@ -24,10 +22,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: branch: ${{ inputs.target_branch }} - - name: Set output - id: output - run: | - echo "target_branch=${{ inputs.target_branch }}" >> $GITHUB_OUTPUT UpdateOnNewBranch: needs: CreateTempBranch From 4706d9d073dd880392d603c9bd528216681cec79 Mon Sep 17 00:00:00 2001 From: joXemMx Date: Fri, 14 Nov 2025 00:05:21 +0100 Subject: [PATCH 12/14] update action version --- .github/workflows/SetupBranch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/SetupBranch.yml b/.github/workflows/SetupBranch.yml index 1967270a..cc05ccc8 100644 --- a/.github/workflows/SetupBranch.yml +++ b/.github/workflows/SetupBranch.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Create Branch - uses: peterjgrainger/action-create-branch@v2.2.0 + uses: peterjgrainger/action-create-branch@v3.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From cca514bcf82cfd5372e42d298ed1cdb4541f93ed Mon Sep 17 00:00:00 2001 From: joXemMx Date: Fri, 14 Nov 2025 10:11:03 +0100 Subject: [PATCH 13/14] remove obsolete caching workflow --- .github/workflows/update-api.yml | 41 -------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 .github/workflows/update-api.yml diff --git a/.github/workflows/update-api.yml b/.github/workflows/update-api.yml deleted file mode 100644 index 37293bb0..00000000 --- a/.github/workflows/update-api.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: UpdateApi -on: [workflow_call, workflow_dispatch] -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v3 - - name: Cache Sirius Release - id: cache-sirius - uses: actions/cache@v3 - with: - path: .updater/api/sirius - key: sirius - - name: Check if cache is Empty - if: steps.cache-sirius.outputs.cache-hit != 'true' - uses: nick-fields/retry@v2 - with: - max_attempts: 5 - timeout_minutes: 2 - command: | - cd .updater/api - curl -s https://api.github.com/repositories/94561614/releases | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -nv -i - echo "Download Complete" - unzip -o *.zip - echo "Api Ready" - - name: Check cached version - uses: nick-fields/retry@v2 - with: - max_attempts: 5 - timeout_minutes: 2 - command: | - cd .updater/api - currVersion=$(cat ./sirius/HashCode) - curl -s https://api.github.com/repositories/94561614/releases | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -nv -i - newVersion=$(cat *.sha256 | cut -d " " -f 1) - echo New Version is $newVersion - if [ "$currVersion" != "$newVersion" ]; then - sleep 1 - curl -s https://api.github.com/repositories/94561614/releases | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -nv -i - - unzip -o *.zip - echo $newVersion > ./sirius/HashCode - fi \ No newline at end of file From 1d9bdedfc8e4e82915ec0f650eaadfe9dd0b547b Mon Sep 17 00:00:00 2001 From: joXemMx Date: Fri, 14 Nov 2025 13:06:10 +0100 Subject: [PATCH 14/14] link tests in package readme --- client-api_python/README.md | 5 +++-- client-api_r/README.md | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client-api_python/README.md b/client-api_python/README.md index 1ed09fb1..15404336 100644 --- a/client-api_python/README.md +++ b/client-api_python/README.md @@ -1,8 +1,9 @@ # PySirius REST API that provides the full functionality of SIRIUS and its web services as background service. It is intended as entry-point for scripting languages and software integration SDKs. -- to [fine-grained documentation](#documentation-for-api-endpoints) -- to our [example workflow](#example-usage-of-pysirius) +- To our [example workflow](#example-usage-of-pysirius) +- To the [fine-grained documentation](#documentation-for-api-endpoints) +- To the [tests](generated/test/) ## Installation & Usage diff --git a/client-api_r/README.md b/client-api_r/README.md index 89ed5c22..b285b222 100644 --- a/client-api_r/README.md +++ b/client-api_r/README.md @@ -7,8 +7,9 @@ REST API that provides the full functionality of SIRIUS and its web services as background service. It is intended as entry-point for scripting languages and software integration SDKs. -- to [fine-grained documentation](#documentation-for-api-endpoints) -- to our [example workflow](#example-usage-of-rsirius) +- To our [example workflow](#example-usage-of-rsirius) +- To the [fine-grained documentation](#documentation-for-api-endpoints) +- To the [tests](generated/tests/testthat/) ## Installation & Usage