Skip to content

build(deps): bump github.com/docker/docker from 24.0.9+incompatible to 25.0.6+incompatible in /go/appencryption/integrationtest #24

build(deps): bump github.com/docker/docker from 24.0.9+incompatible to 25.0.6+incompatible in /go/appencryption/integrationtest

build(deps): bump github.com/docker/docker from 24.0.9+incompatible to 25.0.6+incompatible in /go/appencryption/integrationtest #24

name: 'Cross Language Validation'
on:
workflow_dispatch:
inputs:
go-version:
description: 'Go version'
required: false
java-version:
description: 'Java version'
required: false
pull_request:
branches:
- main
paths:
- '.github/workflows/cross-language-validation.yml'
- 'tests/cross-language/**'
- 'go/**'
- 'java/**'
- 'csharp/**'
- 'server/**'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-cross-lang-${{ github.ref }}
cancel-in-progress: true
env:
DYNAMODB_HOSTNAME: dynamodb
MYSQL_HOSTNAME: mysql
MYSQL_DATABASE: testdb
MYSQL_USERNAME: root
MYSQL_PASSWORD: Password123
DISABLE_TESTCONTAINERS: true
AWS_ACCESS_KEY_ID: dummykey
AWS_SECRET_ACCESS_KEY: dummy_secret
AWS_DEFAULT_REGION: us-west-2
AWS_REGION: us-west-2
jobs:
init-defaults:
name: Init Defaults
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.init.outputs.go-version }}
java-version: ${{ steps.init.outputs.java-version }}
steps:
- id: init
name: Init versions
run: |
go_version="${{ inputs.go-version }}"
if [ -z "${go_version}" ]; then
go_version='stable'
fi
echo "Go version: ${go_version}"
echo "go-version=${go_version}" >> $GITHUB_OUTPUT
java_version="${{ inputs.java-version }}"
if [ -z "${java_version}" ]; then
java_version='17'
fi
echo "Java version: ${java_version}"
echo "java-version=${java_version}" >> $GITHUB_OUTPUT
server-samples:
name: 'Server Samples: Build & Test'
runs-on: ubuntu-latest
needs: init-defaults
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get -y upgrade --fix-missing
sudo apt-get install -y build-essential
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: ${{ needs.init-defaults.outputs.go-version }}
cache-dependency-path: 'go/*/go.sum'
- name: Set up Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: ${{ needs.init-defaults.outputs.java-version }}
distribution: 'temurin'
cache: 'maven'
cache-dependency-path: 'java/*/pom.xml'
- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.x'
cache: 'pip'
- name: Set up Node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 'current'
- name: Build the Java project
run: |
mvn -v
# Delete previous builds and rebuild from the current branch
rm -rf ~/.m2/repository/com/godaddy/asherah/grpc-server ~/.m2/repository/com/godaddy/asherah/appencryption
mvn --no-transfer-progress clean install -f java/app-encryption/pom.xml -DskipTests
mvn --no-transfer-progress clean install -f server/java/pom.xml -DskipTests
- name: Test clients
run: |
cd server/samples/clients
./test_clients.sh
cross-language-tests:
name: Cross-Language Tests
runs-on: ubuntu-latest
needs: init-defaults
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_PASSWORD }}
ports:
- 3306
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up C#
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: |
3.1.x
6.0.x
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: ${{ needs.init-defaults.outputs.go-version }}
cache-dependency-path: 'go/*/go.sum'
- name: Set up Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: ${{ needs.init-defaults.outputs.java-version }}
distribution: 'temurin'
cache: 'maven'
cache-dependency-path: 'java/*/pom.xml'
- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.x'
cache: 'pip'
- name: Initialize RDBMS based metastore
run: |
mysql -h 127.0.0.1 -P${{ job.services.mysql.ports[3306] }} -u ${{ env.MYSQL_USERNAME }} -p${{ env.MYSQL_PASSWORD }} -e "CREATE TABLE ${{ env.MYSQL_DATABASE }}.encryption_key (
id VARCHAR(255) NOT NULL,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
key_record TEXT NOT NULL,
PRIMARY KEY (id, created),
INDEX (created)
);"
- name: Build the Java project
run: |
mvn -v
# Delete previous builds and rebuild from the current branch
rm -rf ~/.m2/repository/com/godaddy/asherah/grpc-server ~/.m2/repository/com/godaddy/asherah/appencryption
mvn --no-transfer-progress clean install -f java/app-encryption/pom.xml -DskipTests
mvn --no-transfer-progress clean install -f server/java/pom.xml -DskipTests
cd tests/cross-language/java
./scripts/build.sh
- name: Build the C# project
run: |
cd tests/cross-language/csharp
./scripts/clean.sh
# Workaround for https://github.com/SpecFlowOSS/SpecFlow/issues/1912#issue-583000545
export MSBUILDSINGLELOADCONTEXT=1
./scripts/build.sh
- name: Lint & Build the Go project
run: |
cd tests/cross-language/go
./scripts/lint.sh
go mod edit -replace github.com/godaddy/asherah/go/appencryption=../../../go/appencryption
go install github.com/cucumber/godog/cmd/godog@latest
./scripts/build.sh
- name: Test
env:
TEST_DB_NAME: ${{ env.MYSQL_DATABASE }}
TEST_DB_PASSWORD: ${{ env.MYSQL_PASSWORD }}
TEST_DB_USER: ${{ env.MYSQL_USERNAME }}
TEST_DB_HOSTNAME: localhost
TEST_DB_PORT: ${{ job.services.mysql.ports[3306] }}
ASHERAH_SERVICE_NAME: service
ASHERAH_PRODUCT_NAME: product
ASHERAH_KMS_MODE: static
run: |
export JAVA_AE_VERSION=$(mvn -f java/app-encryption/pom.xml -q -DforceStdout help:evaluate -Dexpression=project.version)
cd tests/cross-language/
./scripts/encrypt_all.sh
./scripts/decrypt_all.sh