add azure-cosmos to integration test azure-services-disabled #120
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: Build | |
on: | |
push: | |
branches: | |
- "main" | |
paths-ignore: | |
- '.gitignore' | |
- 'CODEOWNERS' | |
- 'LICENSE' | |
- '*.md' | |
- '*.adoc' | |
- '*.txt' | |
- '.all-contributorsrc' | |
pull_request: | |
paths-ignore: | |
- '.gitignore' | |
- 'CODEOWNERS' | |
- 'LICENSE' | |
- '*.md' | |
- '*.adoc' | |
- '*.txt' | |
- '.all-contributorsrc' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
# In order to run tests against the real Azure services, you need to create a GitHub environment "ci" and add AZURE_CLIENT_ID / AZURE_TENANT_ID / AZURE_SUBSCRIPTION_ID as its variables to enable OIDC authentication with Azure. | |
# See https://aka.ms/config-federated-identity-on-uami for more information on how to configure federated identity credential on a user-assigned managed identity (uami) and retrieve values for these required GitHub variables. | |
# Besides, the uami needs to be granted the "Contributor" role on the subscription to deploy and delete Azure resources for testing. | |
jobs: | |
build: | |
permissions: | |
id-token: write | |
environment: ci | |
env: | |
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }} | |
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }} | |
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }} | |
RESOURCE_GROUP_NAME: ${{ github.repository_owner }}-quarkus${{ github.run_id }}${{ github.run_number }} | |
STORAGE_ACCOUNT_NAME: storage${{ github.run_id }}${{ github.run_number }} | |
APP_CONFIG_NAME: appconfig${{ github.run_id }}${{ github.run_number }} | |
KEY_VAULT_NAME: kv${{ github.run_id }}${{ github.run_number }} | |
COSMOSDB_ACCOUNT_NAME: cosmos${{ github.run_id }}${{ github.run_number }} | |
name: Build on ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# os: [windows-latest, macos-latest, ubuntu-latest] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Prepare git | |
run: git config --global core.autocrlf false | |
if: startsWith(matrix.os, 'windows') | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: 'maven' | |
- name: Build with Maven | |
run: mvn -B clean install -Dno-format | |
- name: Build with Maven (Native) | |
run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip | |
- name: Az CLI login | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ env.AZURE_CLIENT_ID }} | |
tenant-id: ${{ env.AZURE_TENANT_ID }} | |
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }} | |
if: ${{ env.AZURE_CLIENT_ID != '' && env.AZURE_TENANT_ID != '' && env.AZURE_SUBSCRIPTION_ID != '' }} | |
- name: Create Azure resources | |
run: .github/create-azure-resources.sh | |
if: ${{ env.AZURE_CLIENT_ID != '' && env.AZURE_TENANT_ID != '' && env.AZURE_SUBSCRIPTION_ID != '' }} | |
- name: Az CLI login | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ env.AZURE_CLIENT_ID }} | |
tenant-id: ${{ env.AZURE_TENANT_ID }} | |
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }} | |
if: ${{ env.AZURE_CLIENT_ID != '' && env.AZURE_TENANT_ID != '' && env.AZURE_SUBSCRIPTION_ID != '' }} | |
- name: Run tests against Azure services | |
run: | | |
cd integration-tests | |
../.github/run-integration-test.sh | |
if: ${{ env.AZURE_CLIENT_ID != '' && env.AZURE_TENANT_ID != '' && env.AZURE_SUBSCRIPTION_ID != '' }} | |
# Fix error: Client assertion is not within its valid time range. | |
- name: Az CLI login | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ env.AZURE_CLIENT_ID }} | |
tenant-id: ${{ env.AZURE_TENANT_ID }} | |
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }} | |
if: ${{ always() && env.AZURE_CLIENT_ID != '' && env.AZURE_TENANT_ID != '' && env.AZURE_SUBSCRIPTION_ID != '' }} | |
- name: Delete Azure resources | |
run: .github/delete-azure-resources.sh | |
if: ${{ always() && env.AZURE_CLIENT_ID != '' && env.AZURE_TENANT_ID != '' && env.AZURE_SUBSCRIPTION_ID != '' }} | |
- name: Fail if there are uncommitted changes | |
run: | | |
[[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; exit 1; } |