Skip to content

Commit

Permalink
Initial draft GHA improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
msmygit committed Oct 31, 2024
1 parent e6562d6 commit 30c3173
Show file tree
Hide file tree
Showing 11 changed files with 260 additions and 96 deletions.
35 changes: 35 additions & 0 deletions .github/actions/build-with-maven/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Build with Java & Maven'
description: 'Checkout code, set up JDK, and build with Maven'
inputs:
skip_tests:
description: 'Skip tests during Maven build'
required: false
default: 'true'
java_distribution:
description: 'JDK distribution to use'
required: false
default: 'adopt'
java_version:
description: 'JDK version to use'
required: false
default: '11'
cache_name:
description: 'Cache to be used'
required: false
default: 'maven'
runs:
using: 'composite'
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up JDK ${{ inputs.java_version }}
uses: actions/setup-java@v4
with:
distribution: ${{ java_distribution }}
java-version: ${{ inputs.java_version }}
cache: ${{ inputs.cache_name}}

- name: Build with Maven
run: |
mvn install -Dmaven.test.skip=${{ inputs.skip_tests }}
20 changes: 12 additions & 8 deletions .github/workflows/ci-astra-dev-collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Build with Maven
run: |
mvn install -Dmaven.test.skip=true
Expand All @@ -26,12 +27,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Maven Test
env:
ASTRA_DB_APPLICATION_TOKEN_DEV: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN_DEV }}
Expand All @@ -46,12 +48,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Run test for DEV
env:
ASTRA_DB_APPLICATION_TOKEN_DEV: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN_DEV }}
Expand All @@ -66,12 +69,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'

- name: Run test for DEV
env:
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/ci-astra-dev-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Build with Maven
run: |
mvn install -Dmaven.test.skip=true
Expand All @@ -26,12 +27,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Maven Test
env:
ASTRA_DB_APPLICATION_TOKEN_DEV: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN_DEV }}
Expand All @@ -46,12 +48,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Run test for DEV
env:
ASTRA_DB_APPLICATION_TOKEN_DEV: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN_DEV }}
Expand All @@ -66,12 +69,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'

- name: Run test for DEV
env:
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/ci-astra-dev-databaseadmin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Build with Maven
run: |
mvn install -Dmaven.test.skip=true
Expand All @@ -26,12 +27,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Maven Test
env:
ASTRA_DB_APPLICATION_TOKEN_DEV: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN_DEV }}
Expand All @@ -46,12 +48,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Run test for DEV
env:
ASTRA_DB_APPLICATION_TOKEN_DEV: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN_DEV }}
Expand All @@ -66,12 +69,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'

- name: Run test for DEV
env:
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/ci-astra-dev-devops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Build with Maven
run: |
mvn install -Dmaven.test.skip=true
Expand All @@ -26,12 +27,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Maven Test
env:
ASTRA_DB_APPLICATION_TOKEN_DEV: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN_DEV }}
Expand All @@ -46,12 +48,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Run test for DEV
env:
ASTRA_DB_APPLICATION_TOKEN_DEV: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN_DEV }}
Expand All @@ -66,12 +69,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'

- name: Run test for DEV
env:
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/ci-astra-dev-new.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: AstraDev NEW

on:
workflow_dispatch:

jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout & Build
uses: ./.github/actions/build-with-maven

run_dev_tests:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
include:
- cloud_provider: AWS
cloud_region: us-west-2
- cloud_provider: GCP
cloud_region: europe-west4
# - cloud_provider: GCP
# cloud_region: us-central1
steps:
- name: Checkout & Build
uses: ./.github/actions/build-with-maven

- name: Run Maven Tests
env:
ASTRA_DB_APPLICATION_TOKEN_DEV: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN_DEV }}
ASTRA_CLOUD_PROVIDER_DEV: ${{ matrix.cloud_provider }}
ASTRA_CLOUD_REGION_DEV: ${{ matrix.cloud_region }}
run: |
cd astra-db-java
mvn test -Dtest=com.datastax.astra.test.integration.dev.*Test
run_vectorize_tests:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
include:
- cloud_provider: AWS
cloud_region: us-west-2
- cloud_provider: GCP
cloud_region: europe-west4
embedding_provider:
- { name: openai, key: ${{ secrets.OPENAI_API_KEY }} }
- { name: azureOpenAI, key: ${{ secrets.AZURE_OPENAI_API_KEY }} }
- { name: huggingface, key: ${{ secrets.HF_API_KEY }} }
- { name: mistral, key: ${{ secrets.MISTRAL_API_KEY }} }
- { name: voyageAI, key: ${{ secrets.VOYAGE_API_KEY }} }
- { name: upstageAI, key: ${{ secrets.UPSTAGE_API_KEY }} }
- { name: jinaAI, key: ${{ secrets.JINA_API_KEY }} }
- { name: nvidia, key: 'nvidia' } # Not used

steps:
- name: Checkout & Build
uses: ./.github/actions/build-with-maven

- name: Run Maven Tests
env:
ASTRA_DB_APPLICATION_TOKEN_DEV: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN_DEV }}
ASTRA_CLOUD_PROVIDER_DEV: ${{ matrix.cloud_provider }}
ASTRA_CLOUD_REGION_DEV: ${{ matrix.cloud_region }}
EMBEDDING_PROVIDER: ${{ matrix.embedding_provider.name }}
EMBEDDING_API_KEY: ${{ matrix.embedding_provider.key }}
run: |
cd astra-db-java
mvn test -Dtest=com.datastax.astra.test.integration.dev_vectorize.AstraDevVectorizeEmbeddingApiKeyITTest
Loading

0 comments on commit 30c3173

Please sign in to comment.