Add Local Stack for External Storage UnitTesting #4771
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: External Storage Tests | |
on: | |
pull_request: | |
branches: | |
- 'master' | |
- 'release-*' | |
push: | |
branches: | |
- 'master' | |
- 'beta' | |
- 'release-*' | |
jobs: | |
test-external-storages: | |
env: | |
GIT_REF: ${{ github.ref }} | |
GIT_SHA: ${{ github.sha }} | |
Configuration: Release | |
SolutionFile: dotnet\StorageTestSolution.sln | |
SolutionFileName: StorageTestSolution | |
runs-on: ubuntu-latest | |
environment: external-storage-tests | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Docker | |
uses: docker/setup-buildx-action@v2 | |
- name: Start LocalStack | |
run: | | |
docker run -d -p 4566:4566 -p 4572:4572 --name localstack localstack/localstack | |
sleep 10 # Wait for LocalStack to initialize | |
- name: Configure AWS CLI for LocalStack | |
run: | | |
aws configure set aws_access_key_id test | |
aws configure set aws_secret_access_key test | |
aws configure set default.region us-east-1 | |
aws configure set endpoint_url http://localhost:4566 | |
- name: Create S3 Bucket in LocalStack | |
run: aws s3api create-bucket --bucket test-bucket --endpoint-url http://localhost:4566 | |
- name: Install .NET 8 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.x' | |
include-prerelease: true | |
- name: Install libgdiplus | |
run: sudo apt-get install -y libgdiplus | |
- name: Create temporary solution with .NET 8 projects | |
run: | | |
dotnet new sln --name $SolutionFileName --output dotnet --force | |
dotnet msbuild dotnet/DotNetStandardClasses.sln /t:DumpProjectsAndCoreTests -p:DumpSolutionName=$SolutionFileName /m:1 -p:DumpSolutionTargetFrameworkDefault=net8 | |
- name: Restore packages | |
run: dotnet restore $SolutionFile | |
- name: Build | |
run: dotnet build $SolutionFile --no-restore --configuration $Configuration | |
- name: Test External Storage | |
env: | |
AWSS3_TEST_ENABLED: "true" | |
STORAGE_AWSS3_ACCESS_KEY: "test" | |
STORAGE_AWSS3_SECRET_KEY: "test" | |
STORAGE_AWSS3_BUCKET_NAME: "test-bucket" | |
STORAGE_AWSS3_FOLDER_NAME: "gxclasses" | |
STORAGE_AWSS3_REGION: "us-east-1" | |
STORAGE_AWSS3_ENDPOINT: "custom" | |
STORAGE_AWSS3_CUSTOM_ENDPOINT: "http://localhost:4566" | |
IBMCOS_TEST_ENABLED: "true" | |
STORAGE_IBMCOS_ACCESS_KEY: "${{ secrets.IBMCOS_ACCESS_KEY }}" | |
STORAGE_IBMCOS_SECRET_KEY: "${{ secrets.IBMCOS_SECRET_KEY }}" | |
STORAGE_IBMCOS_BUCKET_NAME: "gxclasses-unit-tests" | |
STORAGE_IBMCOS_FOLDER_NAME: "tests" | |
STORAGE_IBMCOS_REGION: "us-south" | |
AZUREBS_TEST_ENABLED: "true" | |
STORAGE_AZUREBS_ACCESS_KEY: "${{ secrets.AZUREBS_ACCESS_KEY }}" | |
STORAGE_AZUREBS_ACCOUNT_NAME: "${{ secrets.AZUREBS_ACCOUNT_NAME }}" | |
STORAGE_AZUREBS_FOLDER_NAME: "tests" | |
STORAGE_AZUREBS_PUBLIC_CONTAINER_NAME: "contluispublic" | |
STORAGE_AZUREBS_PRIVATE_CONTAINER_NAME: "contluisprivate" | |
GOOGLECS_TEST_ENABLED: "true" | |
STORAGE_GOOGLECS_KEY: '${{ secrets.GOOGLECS_KEY }}' | |
STORAGE_GOOGLECS_PROJECT_ID: "gxjavacloudstorageunittests" | |
STORAGE_GOOGLECS_BUCKET_NAME: "javaclasses-unittests" | |
STORAGE_GOOGLECS_FOLDER_NAME: "gxclasses" | |
STORAGE_GOOGLECS_APPLICATION_NAME: "gxjavacloudstorageunittests" | |
run: dotnet test $SolutionFile --no-restore --no-build --configuration $Configuration |