Quarkus ecosystem CI #499
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: "Quarkus ecosystem CI" | |
on: | |
workflow_dispatch: | |
watch: | |
types: [started] | |
# For this CI to work, ECOSYSTEM_CI_TOKEN needs to contain a GitHub with rights to close the Quarkus issue that the user/bot has opened, | |
# while 'ECOSYSTEM_CI_REPO_PATH' needs to be set to the corresponding path in the 'quarkusio/quarkus-ecosystem-ci' repository | |
env: | |
ECOSYSTEM_CI_REPO: quarkusio/quarkus-ecosystem-ci | |
ECOSYSTEM_CI_REPO_FILE: context.yaml | |
JAVA_VERSION: 17 | |
######################### | |
# Repo specific setting # | |
######################### | |
ECOSYSTEM_CI_REPO_PATH: quarkiverse-azure-services | |
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 against latest Quarkus snapshot" | |
runs-on: ubuntu-latest | |
# Allow <ADMIN> to manually launch the ecosystem CI in addition to the bots | |
if: github.actor == 'quarkusbot' || github.actor == 'quarkiversebot' || github.actor == '<ADMIN>' | |
steps: | |
- name: Install yq | |
uses: dcarbone/[email protected] | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
path: current-repo | |
- name: Checkout Ecosystem | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ env.ECOSYSTEM_CI_REPO }} | |
path: ecosystem-ci | |
- name: Setup and Run Tests | |
run: ./ecosystem-ci/setup-and-test | |
env: | |
ECOSYSTEM_CI_TOKEN: ${{ secrets.ECOSYSTEM_CI_TOKEN }} | |
- 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: | | |
cd ${GITHUB_WORKSPACE}/current-repo/integration-tests | |
../.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 ${GITHUB_WORKSPACE}/current-repo/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: | | |
cd ${GITHUB_WORKSPACE}/current-repo/integration-tests | |
../.github/delete-azure-resources.sh | |
if: ${{ always() && env.AZURE_CLIENT_ID != '' && env.AZURE_TENANT_ID != '' && env.AZURE_SUBSCRIPTION_ID != '' }} |