From fbea60f6fbd627f8579c4ad85e7c6d6ef10d3c1c Mon Sep 17 00:00:00 2001 From: Noor Dawod Date: Wed, 8 May 2024 12:48:14 +0200 Subject: [PATCH] Make sure code is checked out in CI. --- .github/actions/clone/action.yml | 14 -------------- .github/actions/java/action.yml | 9 +++++++++ .github/actions/lint/action.yml | 8 ++++---- .github/workflows/build.yml | 10 ++++++++++ .github/workflows/publish.yml | 10 ++++++++++ 5 files changed, 33 insertions(+), 18 deletions(-) delete mode 100644 .github/actions/clone/action.yml create mode 100644 .github/actions/java/action.yml diff --git a/.github/actions/clone/action.yml b/.github/actions/clone/action.yml deleted file mode 100644 index f9af81c..0000000 --- a/.github/actions/clone/action.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "Clone code and set up Java" - -runs: - using: "composite" - steps: - - name: "Clone code" - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: "Set up Adopt OpenJDK 17" - uses: actions/setup-java@v3 - with: - distribution: adopt - java-version: 17 diff --git a/.github/actions/java/action.yml b/.github/actions/java/action.yml new file mode 100644 index 0000000..daf47a4 --- /dev/null +++ b/.github/actions/java/action.yml @@ -0,0 +1,9 @@ +name: "Set up Adopt OpenJDK 17" + +runs: + using: "composite" + steps: + - uses: actions/setup-java@v3 + with: + distribution: adopt + java-version: 17 diff --git a/.github/actions/lint/action.yml b/.github/actions/lint/action.yml index 03b7a6c..2530c23 100644 --- a/.github/actions/lint/action.yml +++ b/.github/actions/lint/action.yml @@ -3,9 +3,9 @@ name: "Lint code" runs: using: "composite" steps: - - name: "Clone code and set up Java" - uses: ./.github/actions/clone - - name: "Detekt" + - name: "Set up Adopt OpenJDK 17" + uses: ./.github/actions/java + - name: "Run Detekt" run: sh gradlew detekt - - name: "KtLint" + - name: "Run KtLint" run: sh gradlew ktlintCheck diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 923f8ed..d015f0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,10 @@ jobs: lint: runs-on: ubuntu-latest steps: + - name: "Clone code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: "Lint code" uses: ./.github/actions/lint @@ -17,5 +21,11 @@ jobs: needs: lint runs-on: macos-latest steps: + - name: "Clone code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: "Set up Adopt OpenJDK 17" + uses: ./.github/actions/java - name: "Validate Gradle wrapper" uses: gradle/wrapper-validation-action@v1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7db65d6..aab9322 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,10 @@ jobs: lint: runs-on: ubuntu-latest steps: + - name: "Clone code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: "Lint code" uses: ./.github/actions/lint @@ -16,6 +20,12 @@ jobs: needs: lint runs-on: macos-latest steps: + - name: "Clone code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: "Set up Adopt OpenJDK 17" + uses: ./.github/actions/java - name: "Validate Gradle wrapper" uses: gradle/wrapper-validation-action@v1