Skip to content

Commit 65ad41d

Browse files
committed
Fix workflow
1 parent 45f2a04 commit 65ad41d

File tree

2 files changed

+121
-78
lines changed

2 files changed

+121
-78
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Test Object Storage Adapter
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
INT_TEST_JAVA_RUNTIME_VERSION:
7+
description: JDK version used to run the integration test
8+
type: choice
9+
required: false
10+
default: '8'
11+
options:
12+
- '8'
13+
- '11'
14+
- '17'
15+
- '21'
16+
INT_TEST_JAVA_RUNTIME_VENDOR:
17+
description: Vendor of the JDK used to run the integration test
18+
type: choice
19+
required: false
20+
default: 'temurin'
21+
options:
22+
- 'corretto'
23+
- 'microsoft'
24+
- 'oracle'
25+
- 'temurin'
26+
27+
env:
28+
TERM: dumb
29+
JAVA_VERSION: '8'
30+
JAVA_VENDOR: 'temurin'
31+
INT_TEST_JAVA_RUNTIME_VERSION: "${{ github.event_name != 'workflow_dispatch' && '8' || inputs.INT_TEST_JAVA_RUNTIME_VERSION }}"
32+
INT_TEST_JAVA_RUNTIME_VENDOR: "${{ github.event_name != 'workflow_dispatch' && 'temurin' || inputs.INT_TEST_JAVA_RUNTIME_VENDOR }}"
33+
# Gradle will parse 'ORG_GRADLE_PROJECT_<project_property_name>' environment variables as project properties.
34+
# The following variables configure the 'com.scalar.db.jdk-configuration' Gradle plugin.
35+
ORG_GRADLE_PROJECT_javaVersion: '8'
36+
ORG_GRADLE_PROJECT_javaVendor: 'temurin'
37+
ORG_GRADLE_PROJECT_integrationTestJavaRuntimeVersion: "${{ github.event_name != 'workflow_dispatch' && '8' || inputs.INT_TEST_JAVA_RUNTIME_VERSION }}"
38+
ORG_GRADLE_PROJECT_integrationTestJavaRuntimeVendor: "${{ github.event_name != 'workflow_dispatch' && 'temurin' || inputs.INT_TEST_JAVA_RUNTIME_VENDOR }}"
39+
# This variable evaluates to: if {!(Temurin JDK 8) && !(Oracle JDK)} then {true} else {false}
40+
# Oracle JDK that are linux compatible and publicly available through direct download exist for all LTS versions
41+
SET_UP_INT_TEST_RUNTIME_NON_ORACLE_JDK: "${{ (github.event_name == 'workflow_dispatch' && !(inputs.INT_TEST_JAVA_RUNTIME_VERSION == '8' && inputs.INT_TEST_JAVA_RUNTIME_VENDOR == 'temurin') && !(inputs.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle')) && 'true' || 'false' }}"
42+
INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT: '"-Dscalardb.consensus_commit.coordinator.group_commit.enabled=true" "-Dscalardb.consensus_commit.coordinator.group_commit.old_group_abort_timeout_millis=15000" --tests "**.ConsensusCommit**"'
43+
CLOUD_STORAGE_PROJECT_ID: ${{ secrets.CLOUD_STORAGE_PROJECT_ID }}
44+
CLOUD_STORAGE_SERVICE_ACCOUNT_KEY: ${{ secrets.CLOUD_STORAGE_SERVICE_ACCOUNT_KEY }}
45+
CLOUD_STORAGE_BUCKET_BASE_NAME: scalardb-test-bucket
46+
47+
jobs:
48+
integration-test-cloud-storage:
49+
name: Cloud Storage integration test (${{ matrix.test_group.label }})
50+
runs-on: ubuntu-latest
51+
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
test_group:
56+
- label: storage_scan
57+
tests_filter: '--tests "**.ObjectStorageSingle**" --tests "**.ObjectStorageMultiple**"'
58+
bucket_suffix: storage-scan
59+
group_commit_enabled: false
60+
- label: storage_wrapper
61+
tests_filter: '--tests "**.ObjectStorageWrapper**"'
62+
bucket_suffix: storage-wrapper
63+
group_commit_enabled: false
64+
- label: storage_admin
65+
tests_filter: '--tests "**.ObjectStorageAdmin**"'
66+
bucket_suffix: storage-admin
67+
group_commit_enabled: false
68+
- label: storage_cm
69+
tests_filter: '--tests "**.ObjectStorageConditionalMutation**"'
70+
bucket_suffix: storage-cm
71+
group_commit_enabled: false
72+
- label: storage_others
73+
tests_filter: '--tests "**.ObjectStorage**" --tests "!**.ObjectStorageSingle**" --tests "!**.ObjectStorageMultiple**" --tests "!**.ObjectStorageWrapper**" --tests "!**.ObjectStorageAdmin**" --tests "!**.ObjectStorageConditionalMutation**"'
74+
bucket_suffix: storage
75+
group_commit_enabled: false
76+
- label: single_crud_operation_transaction
77+
tests_filter: '--tests "**.SingleCrudOperationTransaction**"'
78+
bucket_suffix: single-crud
79+
group_commit_enabled: false
80+
81+
steps:
82+
- uses: actions/checkout@v5
83+
84+
- name: Set up JDK ${{ env.JAVA_VERSION }} (${{ env.JAVA_VENDOR }})
85+
uses: actions/setup-java@v5
86+
with:
87+
java-version: ${{ env.JAVA_VERSION }}
88+
distribution: ${{ env.JAVA_VENDOR }}
89+
90+
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}) to run integration test
91+
uses: actions/setup-java@v5
92+
if: ${{ env.SET_UP_INT_TEST_RUNTIME_NON_ORACLE_JDK == 'true'}}
93+
with:
94+
java-version: ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}
95+
distribution: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}
96+
97+
- name: Login to Oracle container registry
98+
uses: docker/login-action@v3
99+
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
100+
with:
101+
registry: container-registry.oracle.com
102+
username: ${{ secrets.OCR_USERNAME }}
103+
password: ${{ secrets.OCR_TOKEN }}
104+
105+
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (oracle) to run the integration test
106+
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
107+
run: |
108+
container_id=$(docker create "container-registry.oracle.com/java/jdk:${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}")
109+
docker cp -L "$container_id:/usr/java/default" /usr/lib/jvm/oracle-jdk && docker rm "$container_id"
110+
- name: Setup Gradle
111+
uses: gradle/actions/setup-gradle@v5
112+
113+
- name: Execute Gradle 'integrationTestObjectStorage' task
114+
run: ./gradlew integrationTestObjectStorage -Dscalardb.object_storage.storage=cloud-storage -Dscalardb.object_storage.endpoint=${{ env.CLOUD_STORAGE_BUCKET_BASE_NAME }}-${{ matrix.test_group.bucket_suffix }} -Dscalardb.object_storage.username='${{ env.CLOUD_STORAGE_PROJECT_ID }}' -Dscalardb.object_storage.password='${{ env.CLOUD_STORAGE_SERVICE_ACCOUNT_KEY }}' ${{ matrix.test_group.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }} ${{ matrix.test_group.tests_filter }}
115+
116+
- name: Upload Gradle test reports
117+
if: always()
118+
uses: actions/upload-artifact@v5
119+
with:
120+
name: cloud_storage_integration_test_reports_${{ matrix.test_group.label }}
121+
path: core/build/reports/tests/integrationTestObjectStorage

.github/workflows/object-storage-adapter-check.yaml renamed to .github/workflows/s3-adapter-check.yaml

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ env:
4444
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
4545
S3_REGION: us-east-1
4646
S3_BUCKET_BASE_NAME: s3-scalardb-test-bucket
47-
CLOUD_STORAGE_PROJECT_ID: ${{ secrets.CLOUD_STORAGE_PROJECT_ID }}
48-
CLOUD_STORAGE_SERVICE_ACCOUNT_KEY: ${{ secrets.CLOUD_STORAGE_SERVICE_ACCOUNT_KEY }}
49-
CLOUD_STORAGE_BUCKET_BASE_NAME: scalardb-test-bucket
5047

5148
jobs:
5249
integration-test-s3:
@@ -135,78 +132,3 @@ jobs:
135132
with:
136133
name: s3_integration_test_reports_${{ matrix.test_group.label }}
137134
path: core/build/reports/tests/integrationTestObjectStorage
138-
139-
integration-test-cloud-storage:
140-
name: Cloud Storage integration test (${{ matrix.test_group.label }})
141-
runs-on: ubuntu-latest
142-
143-
strategy:
144-
fail-fast: false
145-
matrix:
146-
test_group:
147-
- label: storage_scan
148-
tests_filter: '--tests "**.ObjectStorageSingle**" --tests "**.ObjectStorageMultiple**"'
149-
bucket_suffix: storage-scan
150-
group_commit_enabled: false
151-
- label: storage_wrapper
152-
tests_filter: '--tests "**.ObjectStorageWrapper**"'
153-
bucket_suffix: storage-wrapper
154-
group_commit_enabled: false
155-
- label: storage_admin
156-
tests_filter: '--tests "**.ObjectStorageAdmin**"'
157-
bucket_suffix: storage-admin
158-
group_commit_enabled: false
159-
- label: storage_cm
160-
tests_filter: '--tests "**.ObjectStorageConditionalMutation**"'
161-
bucket_suffix: storage-cm
162-
group_commit_enabled: false
163-
- label: storage_others
164-
tests_filter: '--tests "**.ObjectStorage**" --tests "!**.ObjectStorageSingle**" --tests "!**.ObjectStorageMultiple**" --tests "!**.ObjectStorageWrapper**" --tests "!**.ObjectStorageAdmin**" --tests "!**.ObjectStorageConditionalMutation**"'
165-
bucket_suffix: storage
166-
group_commit_enabled: false
167-
- label: single_crud_operation_transaction
168-
tests_filter: '--tests "**.SingleCrudOperationTransaction**"'
169-
bucket_suffix: single-crud
170-
group_commit_enabled: false
171-
172-
steps:
173-
- uses: actions/checkout@v5
174-
175-
- name: Set up JDK ${{ env.JAVA_VERSION }} (${{ env.JAVA_VENDOR }})
176-
uses: actions/setup-java@v5
177-
with:
178-
java-version: ${{ env.JAVA_VERSION }}
179-
distribution: ${{ env.JAVA_VENDOR }}
180-
181-
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}) to run integration test
182-
uses: actions/setup-java@v5
183-
if: ${{ env.SET_UP_INT_TEST_RUNTIME_NON_ORACLE_JDK == 'true'}}
184-
with:
185-
java-version: ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}
186-
distribution: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}
187-
188-
- name: Login to Oracle container registry
189-
uses: docker/login-action@v3
190-
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
191-
with:
192-
registry: container-registry.oracle.com
193-
username: ${{ secrets.OCR_USERNAME }}
194-
password: ${{ secrets.OCR_TOKEN }}
195-
196-
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (oracle) to run the integration test
197-
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
198-
run: |
199-
container_id=$(docker create "container-registry.oracle.com/java/jdk:${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}")
200-
docker cp -L "$container_id:/usr/java/default" /usr/lib/jvm/oracle-jdk && docker rm "$container_id"
201-
- name: Setup Gradle
202-
uses: gradle/actions/setup-gradle@v5
203-
204-
- name: Execute Gradle 'integrationTestObjectStorage' task
205-
run: ./gradlew integrationTestObjectStorage -Dscalardb.object_storage.storage=cloud-storage -Dscalardb.object_storage.endpoint=${{ env.CLOUD_STORAGE_BUCKET_BASE_NAME }}-${{ matrix.test_group.bucket_suffix }} -Dscalardb.object_storage.username='${{ env.CLOUD_STORAGE_PROJECT_ID }}' -Dscalardb.object_storage.password='${{ env.CLOUD_STORAGE_SERVICE_ACCOUNT_KEY }}' ${{ matrix.test_group.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }} ${{ matrix.test_group.tests_filter }}
206-
207-
- name: Upload Gradle test reports
208-
if: always()
209-
uses: actions/upload-artifact@v5
210-
with:
211-
name: cloud_storage_integration_test_reports_${{ matrix.test_group.label }}
212-
path: core/build/reports/tests/integrationTestObjectStorage

0 commit comments

Comments
 (0)