From 891b3a220318d8d03fc6651e044399a4e53f0909 Mon Sep 17 00:00:00 2001 From: snsaqua8 Date: Tue, 27 Jan 2026 10:49:53 +0100 Subject: [PATCH 1/2] change base branch to main and cleanup commits --- .github/workflows/run-tests-ci.yml | 106 +++++++++++++++++++++++++++++ test-scripts/README.md | 19 +++--- 2 files changed, 116 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/run-tests-ci.yml diff --git a/.github/workflows/run-tests-ci.yml b/.github/workflows/run-tests-ci.yml new file mode 100644 index 0000000..4631571 --- /dev/null +++ b/.github/workflows/run-tests-ci.yml @@ -0,0 +1,106 @@ +# GitHub Actions workflow for testing the SDK example project +# Supports x86_64 architecture +name: Run Tests CI + +# Trigger conditions +on: + # Run on pushes to main branch + push: + branches: [ "main"] + paths: + - 'examples/**' + - 'test-scripts/**' + - 'Dockerfile' + - '.github/workflows/run-tests-ci.yml' + # Run on pull requests to main branch + pull_request: + branches: [ "main" ] + paths: + - 'examples/**' + - 'test-scripts/**' + - 'Dockerfile' + - '.github/workflows/run-tests-ci.yml' + # Allow manual triggering with custom parameters + workflow_dispatch: + inputs: + sdk_version: + description: 'SDK Version to test' + required: false + type: string + test_suite: + description: 'Test suite to run' + required: false + default: 'all' + type: choice + options: + - all + - python + - java + - nodejs + - c + +# Global environment variables +env: + SDK_VERSION: '0.800.5' + +jobs: + test-x86_64: + name: Test x86_64 Architecture + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + # Get the source code + - name: Checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + # Build the Docker image using the existing Dockerfile + - name: Build Docker image (x86_64) + run: | + docker build \ + --build-arg SDK_VERSION=${{ inputs.sdk_version || env.SDK_VERSION }} \ + --build-arg ARCH=linux-x86_64 \ + --build-arg SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \ + --target all-tests \ + -t scanbot-linux-x86_64:latest . + + # Run the test suite with secure stdin approach + - name: Run test suite (x86_64) + run: | + case "${{ inputs.test_suite || 'all' }}" in + "python") + echo "Running Python tests..." + docker run --rm \ + -e SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \ + scanbot-linux-x86_64:latest \ + bash -c '/workspace/test-scripts/test-python.sh 2>&1 | tee /workspace/test.log' + ;; + "java") + echo "Running Java tests..." + docker run --rm \ + -e SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \ + scanbot-linux-x86_64:latest \ + bash -c '/workspace/test-scripts/test-java.sh 2>&1 | tee /workspace/test.log' + ;; + "nodejs") + echo "Running Node.js tests..." + docker run --rm \ + -e SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \ + scanbot-linux-x86_64:latest \ + bash -c '/workspace/test-scripts/test-nodejs.sh 2>&1 | tee /workspace/test.log' + ;; + "c") + echo "Running C tests..." + docker run --rm \ + -e SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \ + scanbot-linux-x86_64:latest \ + bash -c '/workspace/test-scripts/test-c.sh 2>&1 | tee /workspace/test.log' + ;; + "all"|*) + echo "Running all tests..." + docker run --rm \ + -e SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \ + scanbot-linux-x86_64:latest \ + bash -c '/workspace/test-scripts/run-all-tests.sh 2>&1 | tee /workspace/test.log' + ;; + esac diff --git a/test-scripts/README.md b/test-scripts/README.md index f964203..3132db4 100644 --- a/test-scripts/README.md +++ b/test-scripts/README.md @@ -25,21 +25,22 @@ test-scripts/ ## Running Tests -### 1. Build Test Container +### 1. Set License Key & Version ```bash -docker build \ - --build-arg SDK_VERSION=0.800.3 \ - --build-arg ARCH=linux-aarch64 \ - --build-arg SCANBOT_LICENSE=$SCANBOT_LICENSE \ - --target sdk-verification \ - -t scanbot-test . +export SCANBOT_LICENSE="your-license-key-here" +export SDK_VERSION=0.800.5 ``` -### 2. Set License Key +### 2. Build Test Container ```bash -export SCANBOT_LICENSE="your-license-key-here" +docker build \ + --build-arg SDK_VERSION=$SDK_VERSION \ + --build-arg ARCH=linux-aarch64 \ + --build-arg SCANBOT_LICENSE=$SCANBOT_LICENSE \ + --target base \ + -t scanbot-test . ``` ### 3. Run Tests From 76f26ba8b59cdf587ba2eeaca3923bc489af5374 Mon Sep 17 00:00:00 2001 From: snsaqua8 Date: Tue, 27 Jan 2026 11:31:46 +0100 Subject: [PATCH 2/2] change docker test script location --- .github/workflows/run-tests-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-tests-ci.yml b/.github/workflows/run-tests-ci.yml index 4631571..1462d01 100644 --- a/.github/workflows/run-tests-ci.yml +++ b/.github/workflows/run-tests-ci.yml @@ -73,34 +73,34 @@ jobs: docker run --rm \ -e SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \ scanbot-linux-x86_64:latest \ - bash -c '/workspace/test-scripts/test-python.sh 2>&1 | tee /workspace/test.log' + bash -c '/tests/test-python.sh 2>&1 | tee /tmp/test.log' ;; "java") echo "Running Java tests..." docker run --rm \ -e SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \ scanbot-linux-x86_64:latest \ - bash -c '/workspace/test-scripts/test-java.sh 2>&1 | tee /workspace/test.log' + bash -c '/tests/test-java.sh 2>&1 | tee /tmp/test.log' ;; "nodejs") echo "Running Node.js tests..." docker run --rm \ -e SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \ scanbot-linux-x86_64:latest \ - bash -c '/workspace/test-scripts/test-nodejs.sh 2>&1 | tee /workspace/test.log' + bash -c '/tests/test-nodejs.sh 2>&1 | tee /tmp/test.log' ;; "c") echo "Running C tests..." docker run --rm \ -e SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \ scanbot-linux-x86_64:latest \ - bash -c '/workspace/test-scripts/test-c.sh 2>&1 | tee /workspace/test.log' + bash -c '/tests/test-c.sh 2>&1 | tee /tmp/test.log' ;; "all"|*) echo "Running all tests..." docker run --rm \ -e SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \ scanbot-linux-x86_64:latest \ - bash -c '/workspace/test-scripts/run-all-tests.sh 2>&1 | tee /workspace/test.log' + bash -c '/tests/run-all-tests.sh 2>&1 | tee /tmp/test.log' ;; esac