Skip to content

Commit

Permalink
Refactor workflows to address Gradle cache usage
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudshiftchris committed Jul 24, 2024
1 parent 5e9f7f9 commit c9a98d6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
4 changes: 0 additions & 4 deletions .github/actions/setup-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ runs:
mklink /D %USERPROFILE%\.konan D:\.konan
shell: cmd

# https://github.com/actions/checkout
- name: "Checkout"
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7

# https://github.com/actions/setup-java
- name: "Set up JDK"
uses: "actions/setup-java@v4"
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
run_docs: ${{ steps.docs-changed.outputs.exists }}
run_tests: ${{ steps.non-docs-changed.outputs.exists }}
steps:
# https://github.com/actions/checkout
- name: "Checkout"
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7

- name: "Doc changes"
uses: yumemi-inc/changed-files@v3
id: docs-changed
Expand Down Expand Up @@ -70,6 +74,10 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
# https://github.com/actions/checkout
- name: "Checkout"
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7

- name: Setup build
uses: ./.github/actions/setup-build
with:
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
validate-primary:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- name: "Checkout"
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7

- name: Setup build
uses: ./.github/actions/setup-build
with:
Expand All @@ -51,22 +55,30 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Setup build
uses: ./.github/actions/setup-build
with:
cc-encryption-key: ${{ secrets.GRADLE_CONFIGURATION_CACHE_ENCRYPTION_KEY }}
# https://github.com/actions/checkout
- name: "Checkout"
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7

- name: Setup build
uses: ./.github/actions/setup-build
with:
cc-encryption-key: ${{ secrets.GRADLE_CONFIGURATION_CACHE_ENCRYPTION_KEY }}

- name: Validate tests
run: ./gradlew check --scan --stacktrace
- name: Validate tests
run: ./gradlew check --scan --stacktrace

- name: Post build
uses: ./.github/actions/post-build
- name: Post build
uses: ./.github/actions/post-build

publish-sonatype:
name: Publish all artifacts to Sonatype (Maven Central)
runs-on: macos-latest
needs: [ validate-primary, validate-secondary ]
steps:
# https://github.com/actions/checkout
- name: "Checkout"
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7

- name: Setup build
uses: ./.github/actions/setup-build
with:
Expand Down

0 comments on commit c9a98d6

Please sign in to comment.