Skip to content

Commit

Permalink
Update files based on repository configuration (#218)
Browse files Browse the repository at this point in the history
Co-authored-by: pleo-file-distributor[bot] <114988919+pleo-file-distributor[bot]@users.noreply.github.com>
  • Loading branch information
pleo-file-distributor[bot] authored Aug 3, 2023
1 parent aec9106 commit fe11423
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/assign-random-codeowner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

# Assign random CODEOWNERS unless reviewers have been assigned manually
- name: Assign CODEOWNERS
uses: pleo-io/[email protected].10
uses: pleo-io/[email protected].11
with:
reviewers-to-assign: 2
assign-from-changed-files: true
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
result: ${{ steps.only-config-changed.outputs.only_configuration_files_have_changed }}
steps:
- name: Checkout code
uses: actions/[email protected].0
uses: actions/[email protected].3
with:
fetch-depth: ${{ (github.event.repository.default_branch == github.ref_name && 2) || 0 }}
ref: ${{ github.event.repository.default_branch }}
Expand Down Expand Up @@ -66,12 +66,12 @@ jobs:
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/[email protected].2
uses: actions/[email protected].3

# Login to AWS for fetching CI/CD cache.
- name: Configure AWS credentials
if: ${{ github.event.repository.visibility != 'public' }}
uses: aws-actions/configure-aws-credentials@v2.1.0
uses: aws-actions/configure-aws-credentials@v2.2.0
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CICD_S3_CACHE }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CICD_S3_CACHE }}
Expand All @@ -90,18 +90,19 @@ jobs:

# Set up a JDK environment for building, testing and releasing.
- name: Set up JDK 17
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.12.0
with:
java-version: 17.0.4
java-version: 17
distribution: temurin

# Allow caching Gradle executions to further speed up CI/CD steps invoking Gradle.
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.4.2
uses: gradle/gradle-build-action@v2.7.0
with:
gradle-executable: ./gradlew
gradle-version: wrapper
cache-read-only: true
cache-read-only: ${{ github.event.repository.default_branch != github.ref_name }}
dependency-graph: ${{ github.event.repository.default_branch == github.ref_name && 'generate-and-submit' || 'disabled' }}

# Check whether the project builds.
- name: Gradle Build
Expand All @@ -119,7 +120,7 @@ jobs:

- name: Publish Unit Tests report to GitHub
if: steps.s3-cache.outputs.processed != 'true'
uses: mikepenz/action-junit-report@v3.7.7
uses: mikepenz/action-junit-report@v3.8.0
with:
check_name: Unit Tests report
report_paths: "**/build/test-results/test/TEST-*.xml"
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
analyze-java:
name: Analyze ${{ github.event.repository.language }}
continue-on-error: true
runs-on: ubuntu-latest
runs-on: codeql-runner
timeout-minutes: 30
permissions:
actions: read
Expand All @@ -38,30 +38,28 @@ jobs:
- name: Set Working Language
run: echo "WORKING_LANGUAGE=${{env[format('language_{0}', github.event.repository.language)]}}" >> "$GITHUB_ENV"
# Set up a JDK environment for building, testing and releasing.
- name: Set up JDK 17.0.4
uses: actions/setup-java@v3.11.0
- name: Set up JDK 17
uses: actions/setup-java@v3.12.0
if: ${{ env.WORKING_LANGUAGE == 'java' }}
with:
java-version: 17.0.4
java-version: 17
distribution: temurin

# Allow caching Gradle executions to further speed up CI/CD steps invoking Gradle.
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.4.2
uses: gradle/gradle-build-action@v2.7.0
if: ${{ env.WORKING_LANGUAGE == 'java' }}
with:
gradle-executable: ./gradlew
gradle-version: wrapper
gradle-home-cache-cleanup: true
cache-read-only: true
cache-disabled: true

# Set up a Node environment for JS/TS/Node client generation.
- name: Set up Node 16
- name: Set up Node 20
uses: actions/setup-node@v3
if: ${{ env.WORKING_LANGUAGE == 'javascript' }}
with:
node-version: 16
node-version: 20

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand All @@ -73,7 +71,7 @@ jobs:
tools: latest

- name: Gradle Build
run: ./gradlew classes testClasses --stacktrace -Dorg.gradle.jvmargs=-Xmx4g
run: ./gradlew classes testClasses --stacktrace -Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.parallel=true
if: ${{ env.WORKING_LANGUAGE == 'java' }}
env:
GITHUB_TOKEN: ${{ secrets.GH_REGISTRY_GRADLE_TOKEN }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/format-kotlin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ jobs:

# Checkout code with push privileges.
- name: Checkout code
uses: actions/[email protected].2
uses: actions/[email protected].3
with:
token: ${{ steps.get-admin-token.outputs.token }}

# Set up a JDK environment for building, testing and releasing.
- name: Set up JDK 17.0.4
uses: actions/setup-java@v3.11.0
- name: Set up JDK 17
uses: actions/setup-java@v3.12.0
with:
java-version: 17.0.4
java-version: 17
distribution: temurin

# Allow caching Gradle executions to further speed up CI/CD steps invoking Gradle.
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.4.2
uses: gradle/gradle-build-action@v2.7.0
with:
gradle-executable: ./gradlew
gradle-version: wrapper
Expand All @@ -52,7 +52,7 @@ jobs:
# Format code via the formatkotlin Gradle task.
- name: Format files
run: |
./gradlew formatkotlin --stacktrace
./gradlew formatkotlin
env:
GRADLE_READ_KEY: ${{ secrets.GH_REGISTRY_GRADLE_TOKEN }}

Expand Down
60 changes: 30 additions & 30 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ jobs:
fetch-depth: 0

# Set up a JDK environment for building, testing and releasing.
- name: Setup JDK 17.0.4
uses: actions/setup-java@v3.11.0
- name: Setup JDK 17
uses: actions/setup-java@v3.12.0
with:
java-version: 17.0.4
java-version: 17
distribution: temurin

# Allow caching Gradle executions to further speed up CI/CD steps invoking Gradle.
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.4.2
uses: gradle/gradle-build-action@v2.7.0
with:
gradle-executable: ./gradlew
gradle-version: wrapper
Expand All @@ -65,13 +65,13 @@ jobs:
uses: actions/cache@v3
with:
path: ~/auto
key: dependency--intuit/auto-v10.46.0
key: dependency--intuit/auto-v11.0.0

# Set up Auto for determining the version bump to release.
- name: Setup Auto
if: steps.cache-auto.outputs.cache-hit != 'true'
run: |
curl -vkL -o - https://github.com/intuit/auto/releases/download/v10.46.0/auto-linux.gz | gunzip > ~/auto
curl -vkL -o - https://github.com/intuit/auto/releases/download/v11.0.0/auto-linux.gz | gunzip > ~/auto
chmod a+x ~/auto
# Get the currently released version for determining how big a version jump to release.
Expand Down Expand Up @@ -152,25 +152,25 @@ jobs:
uses: actions/cache@v3
with:
path: ~/auto
key: dependency--intuit/auto-v10.46.0
key: dependency--intuit/auto-v11.0.0

# Set up Auto for generating a CHANGELOG.
- name: Setup Auto
if: steps.cache-auto.outputs.cache-hit != 'true'
run: |
curl -vkL -o - https://github.com/intuit/auto/releases/download/v10.46.0/auto-linux.gz | gunzip > ~/auto
curl -vkL -o - https://github.com/intuit/auto/releases/download/v11.0.0/auto-linux.gz | gunzip > ~/auto
chmod a+x ~/auto
# Setup JDK environment for Gradle build tasks.
- name: Setup JDK 17.0.4
uses: actions/setup-java@v3.11.0
- name: Setup JDK 17
uses: actions/setup-java@v3.12.0
with:
java-version: 17.0.4
java-version: 17
distribution: temurin

# Allow caching Gradle executions to further speed up CI/CD steps invoking Gradle.
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.4.2
uses: gradle/gradle-build-action@v2.7.0
with:
gradle-executable: ./gradlew
gradle-version: wrapper
Expand Down Expand Up @@ -274,15 +274,15 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Setup a JDK environment for running Gradle publishing tasks.
- name: Setup JDK 17.0.4
uses: actions/setup-java@v3.11.0
- name: Setup JDK 17
uses: actions/setup-java@v3.12.0
with:
java-version: 17.0.4
java-version: 17
distribution: temurin

# Allow caching Gradle executions to further speed up CI/CD steps invoking Gradle.
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.4.2
uses: gradle/gradle-build-action@v2.7.0
with:
gradle-executable: ./gradlew
gradle-version: wrapper
Expand Down Expand Up @@ -313,7 +313,7 @@ jobs:
continue-on-error: true
uses: nick-fields/retry@v2
with:
command: ./gradlew publish --parallel --continue --stacktrace
command: ./gradlew publish --parallel --continue --stacktrace --no-configuration-cache
max_attempts: 3 # Attempt to release a maximum of three times
timeout_minutes: 30 # Minutes to wait before attempt times out.
retry_wait_seconds: 5 # Wait 5 seconds before retrying
Expand All @@ -326,7 +326,7 @@ jobs:
# Publish the Kotlin client to the private GitHub Maven repository.
- name: Publish Kotlin OpenAPI client (Gradle)
if: env.releaseOpenAPIClients == 'true'
run: ./gradlew :pleo-${{ github.event.repository.name }}-client-kotlin:publish -x test -x formatKotlin -x functest --stacktrace
run: ./gradlew :pleo-${{ github.event.repository.name }}-client-kotlin:publish -x test -x formatKotlin -x functest --stacktrace --no-configuration-cache
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GRADLE_USER: ${{ secrets.GITHUB_ACTOR }}
Expand Down Expand Up @@ -359,7 +359,7 @@ jobs:
# Publish additional publishing configurations to the private GitHub Maven repository.
- name: Publish additional publishing configurations (Gradle)
if: env.publishAdditionalProjects == 'true' && env.releaseOpenAPIClients == 'true'
run: ./gradlew publish -x test -x formatKotlin -x :pleo-${{ github.event.repository.name }}-client-kotlin:publish -x functest --stacktrace
run: ./gradlew publish -x test -x formatKotlin -x :pleo-${{ github.event.repository.name }}-client-kotlin:publish -x functest --stacktrace --no-configuration-cache
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GRADLE_USER: ${{ secrets.GITHUB_ACTOR }}
Expand Down Expand Up @@ -424,11 +424,11 @@ jobs:
ref: main

# Setup a JDK environment for running Gradle publishing tasks.
- name: Setup JDK 17.0.4
- name: Setup JDK 17
if: env.deploymentEnabled == 'true'
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.12.0
with:
java-version: 17.0.4
java-version: 17
distribution: temurin

# Build the project and generate Docker Image
Expand All @@ -443,7 +443,7 @@ jobs:
# Login to DockerHub for fetching and pushing Docker images.
- name: Login to DockerHub
if: env.deploymentEnabled == 'true'
uses: docker/login-action@v2.1.0
uses: docker/login-action@v2.2.0
with:
username: pleodeployments
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -475,15 +475,15 @@ jobs:

- name: Configure product-dev AWS credentials
if: env.productDevDeploymentEnabled == 'true'
uses: aws-actions/configure-aws-credentials@v2.0.0
uses: aws-actions/configure-aws-credentials@v2.2.0
with:
role-to-assume: arn:aws:iam::${{vars.AWS_ACCOUNT_ID_PRODUCT_DEV}}:role/github/repository/${{ github.event.repository.name }}-github-actions
role-session-name: GitHubActions
aws-region: eu-west-1

- name: Login to Amazon ECR Product dev
if: env.productDevDeploymentEnabled == 'true'
uses: aws-actions/[email protected].0
uses: aws-actions/[email protected].2

- name: Push Docker Image to AWS ECR Product dev
if: env.productDevDeploymentEnabled == 'true'
Expand All @@ -495,7 +495,7 @@ jobs:
- name: Configure staging AWS credentials
if: env.deploymentEnabled == 'true'
uses: aws-actions/configure-aws-credentials@v2.1.0
uses: aws-actions/configure-aws-credentials@v2.2.0
with:
role-to-assume: arn:aws:iam::${{vars.AWS_ACCOUNT_ID_PRODUCT_STAGING}}:role/github/repository/${{ github.event.repository.name }}-github-actions
role-session-name: GitHubActions
Expand All @@ -504,7 +504,7 @@ jobs:
# Allow publishing the built project Docker image to AWS ECR (staging).
- name: Login to Amazon ECR Staging
if: env.deploymentEnabled == 'true'
uses: aws-actions/[email protected].0
uses: aws-actions/[email protected].2

# Publish the built project Docker image to AWS ECR (staging).
- name: Push Docker Image to AWS ECR Staging
Expand All @@ -517,7 +517,7 @@ jobs:
- name: Configure production AWS credentials
if: env.deploymentEnabled == 'true' && env.productionDeploymentEnabled == 'true'
uses: aws-actions/configure-aws-credentials@v2.1.0
uses: aws-actions/configure-aws-credentials@v2.2.0
with:
role-to-assume: arn:aws:iam::${{vars.AWS_ACCOUNT_ID_PRODUCT_PRODUCTION}}:role/github/repository/${{ github.event.repository.name }}-github-actions
role-session-name: GitHubActions
Expand All @@ -526,7 +526,7 @@ jobs:
# Allow publishing the built project Docker image to AWS ECR (production).
- name: Login to AWS ECR Production
if: env.deploymentEnabled == 'true' && env.productionDeploymentEnabled == 'true'
uses: aws-actions/[email protected].0
uses: aws-actions/[email protected].2

# Publish the built project Docker image to AWS ECR (production).
- name: Push Docker Image to AWS ECR Production
Expand All @@ -546,7 +546,7 @@ jobs:
steps:
- name: Trigger deployment
if: env.deploymentEnabled == 'true'
uses: pleo-io/actions/trigger-workflow-dispatch@v19.1.3
uses: pleo-io/actions/trigger-workflow-dispatch@v19.3.0
with:
WORKFLOW_DISPATCH_FILE_NAME: deploy_k8s_primary_ecr.yaml
WORKFLOW_FILE_REF: "refs/heads/${{ github.event.repository.default_branch }}"
Expand Down
Loading

0 comments on commit fe11423

Please sign in to comment.