Skip to content

Bulk write via s3 with replication #230

Bulk write via s3 with replication

Bulk write via s3 with replication #230

Workflow file for this run

name: Packer Script Testing
on:
pull_request:
paths:
- 'packer/**'
- '.github/workflows/packer-test.yml'
push:
branches:
- main
paths:
- 'packer/**'
- '.github/workflows/packer-test.yml'
workflow_dispatch:
jobs:
test-individual-scripts:
name: Test Individual Scripts
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
script:
- cassandra/install/install_cassandra_easy_stress.sh
- base/install/install_python.sh
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build test image
run: |
cd packer
docker build -t easy-db-lab-packer-test .
- name: Test script - ${{ matrix.script }}
run: |
cd packer
./test-script.sh ${{ matrix.script }}
test-changed-scripts:
name: Test Changed Scripts
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build test image
run: |
cd packer
docker build -t easy-db-lab-packer-test .
- name: Detect and test changed scripts
run: |
cd packer
echo "Detecting changed shell scripts..."
# Get list of changed .sh files
CHANGED_SCRIPTS=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep '^packer/.*\.sh$' | grep -v 'test-script.sh' || true)
if [ -z "$CHANGED_SCRIPTS" ]; then
echo "No shell scripts changed in this PR"
exit 0
fi
echo "Changed scripts:"
echo "$CHANGED_SCRIPTS"
# Test each changed script
EXIT_CODE=0
for script in $CHANGED_SCRIPTS; do
# Remove 'packer/' prefix if present
script_path="${script#packer/}"
# Skip deleted files
if [ ! -f "$script" ]; then
echo "⊘ $script_path was deleted, skipping test"
continue
fi
echo "Testing: $script_path"
if ./test-script.sh "$script_path"; then
echo "✓ $script_path passed"
else
echo "✗ $script_path failed"
EXIT_CODE=1
fi
done
exit $EXIT_CODE
test-base-provisioning:
name: Test Base Provisioning Sequence
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Test base provisioning
run: |
cd packer
docker compose up --exit-code-from test-base test-base
- name: Show logs on failure
if: failure()
run: |
cd packer
docker compose logs test-base
test-cassandra-provisioning:
name: Test Cassandra Provisioning Sequence
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Test cassandra provisioning
run: |
cd packer
docker compose up --exit-code-from test-cassandra test-cassandra
- name: Show logs on failure
if: failure()
run: |
cd packer
docker compose logs test-cassandra