Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/run-tests-ci.yml
Original file line number Diff line number Diff line change
@@ -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 '/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 '/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 '/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 '/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 '/tests/run-all-tests.sh 2>&1 | tee /tmp/test.log'
;;
esac
19 changes: 10 additions & 9 deletions test-scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down