From 61a5ec9684d5058ce924f7b2b7166c6ab844ea9d Mon Sep 17 00:00:00 2001 From: Michael Kimberlin Date: Thu, 22 Aug 2024 12:29:06 -0500 Subject: [PATCH] Attempted to adjust native build to use new gcloud actions --- ...velopment.yml => gradle-build-develop.yml} | 0 ...ve.yml => gradle-build-native-feature.yml} | 2 +- .../gradle-dependency-submission.yml | 22 ++++++++ ...t.yml => gradle-deploy-native-develop.yml} | 51 +++++++++---------- 4 files changed, 47 insertions(+), 28 deletions(-) rename .github/workflows/{gradle-build-development.yml => gradle-build-develop.yml} (100%) rename .github/workflows/{gradle-build-feature-native.yml => gradle-build-native-feature.yml} (96%) create mode 100644 .github/workflows/gradle-dependency-submission.yml rename .github/workflows/{gradle-native-build-development.yml => gradle-deploy-native-develop.yml} (77%) diff --git a/.github/workflows/gradle-build-development.yml b/.github/workflows/gradle-build-develop.yml similarity index 100% rename from .github/workflows/gradle-build-development.yml rename to .github/workflows/gradle-build-develop.yml diff --git a/.github/workflows/gradle-build-feature-native.yml b/.github/workflows/gradle-build-native-feature.yml similarity index 96% rename from .github/workflows/gradle-build-feature-native.yml rename to .github/workflows/gradle-build-native-feature.yml index ed73a614b..142b0cf4f 100644 --- a/.github/workflows/gradle-build-feature-native.yml +++ b/.github/workflows/gradle-build-native-feature.yml @@ -1,4 +1,4 @@ -name: Gradle Build Native Image - Feature / Bug +name: Gradle Build - Native - Feature / Bug on: push: branches: diff --git a/.github/workflows/gradle-dependency-submission.yml b/.github/workflows/gradle-dependency-submission.yml new file mode 100644 index 000000000..3aa1f9b73 --- /dev/null +++ b/.github/workflows/gradle-dependency-submission.yml @@ -0,0 +1,22 @@ +name: Gradle Dependency Submission + +on: + push: + branches: [ 'develop', 'master', 'feature-2532/graal' ] + +permissions: + contents: write + +jobs: + dependency-submission: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@v4 diff --git a/.github/workflows/gradle-native-build-development.yml b/.github/workflows/gradle-deploy-native-develop.yml similarity index 77% rename from .github/workflows/gradle-native-build-development.yml rename to .github/workflows/gradle-deploy-native-develop.yml index 07953b729..8c62e2101 100644 --- a/.github/workflows/gradle-native-build-development.yml +++ b/.github/workflows/gradle-deploy-native-develop.yml @@ -12,7 +12,7 @@ jobs: build: runs-on: ubuntu-latest environment: - name: Development + name: Development - Native url: https://checkins-develop-native-tuvcfzotpq-uc.a.run.app/ steps: - uses: actions/checkout@v4 @@ -27,30 +27,26 @@ jobs: with: distribution: 'graalvm' java-version: '21' - - name: Cache SonarQube packages - uses: actions/cache@v4 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar +# - name: Cache SonarQube packages +# uses: actions/cache@v4 +# with: +# path: ~/.sonar/cache +# key: ${{ runner.os }}-sonar +# restore-keys: ${{ runner.os }}-sonar - name: Cache Gradle packages uses: actions/cache@v4 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 - name: Build with Gradle - uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021 - with: - arguments: nativeCompile + run: ./gradlew nativeCompile env: - VITE_APP_API_URL: https://checkins-develop-tuvcfzotpq-uc.a.run.app - - name: Gradle runs tests - uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021 - with: - arguments: nativeTest + VITE_APP_API_URL: https://checkins-develop-native-tuvcfzotpq-uc.a.run.app + - name: Run tests with Gradle + run: ./gradlew nativeTest # - name: Do SonarQube checks # uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021 # with: @@ -64,19 +60,20 @@ jobs: sudo apt-get install python2.7 - name: Export gcloud related env variable run: export CLOUDSDK_PYTHON="/usr/bin/python2" - # Setup gcloud CLI - - uses: google-github-actions/setup-gcloud@v0 + - id: 'auth' + uses: 'google-github-actions/auth@v2' + with: + workload_identity_provider: 'projects/832140020593/locations/global/workloadIdentityPools/github-pool/providers/github-oidc-provider' + service_account: 'sa-github-action@oci-intern-2019.iam.gserviceaccount.com' + - name: 'Set up Cloud SDK' + uses: 'google-github-actions/setup-gcloud@v2' with: - version: "290.0.1" - service_account_key: ${{ secrets.RUN_SA_KEY }} - project_id: ${{ secrets.RUN_PROJECT }} - - name: Auth Configure Docker + version: '>= 363.0.0' + - name: 'Auth Configure Docker' run: |- gcloud --quiet auth configure-docker - name: Build a native docker image - uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021 - with: - arguments: dockerBuildNative + run: ./gradlew dockerBuildNative - name: Push the Docker image to Google Container Registry run: |- cd server @@ -103,7 +100,7 @@ jobs: --set-env-vars "MJ_APIKEY_PUBLIC=${{ secrets.MJ_APIKEY_PUBLIC }}" \ --set-env-vars "MJ_APIKEY_PRIVATE=${{ secrets.MJ_APIKEY_PRIVATE }}" \ --set-env-vars "GIT_HUB_TOKEN=${{ secrets.GIT_HUB_TOKEN }}" \ - --set-env-vars "WEB_ADDRESS=https://checkins-develop-tuvcfzotpq-uc.a.run.app" \ + --set-env-vars "WEB_ADDRESS=https://checkins-develop-native-tuvcfzotpq-uc.a.run.app" \ --set-env-vars "FROM_ADDRESS=kimberlinm@objectcomputing.com" \ --set-env-vars "FROM_NAME=Check-Ins - DEVELOP" \ --set-env-vars "^@^MICRONAUT_ENVIRONMENTS=dev,cloud,google,gcp" \