Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Introduce reusable action for job initialization #2110

Open
wants to merge 1 commit into
base: 4.1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/actions/prepare-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Set up environment for Android build
description: Set up environment for Android build

runs:
using: composite
steps:
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
40 changes: 6 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Set up environment for Android build
uses: ./.github/actions/prepare-env

- name: Build & Test
run: cd projects && ./test.sh
Expand All @@ -47,17 +38,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Set up environment for Android build
uses: ./.github/actions/prepare-env

- name: Build & Install
run: cd projects && ./install.sh
Expand All @@ -70,18 +52,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Set up environment for Android build
uses: ./.github/actions/prepare-env

- name: Test
run: cd projects && ./gradlew :core:koin-core:macosX64Test --no-daemon --stacktrace

16 changes: 5 additions & 11 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,12 @@ jobs:
matrix:
language: [ 'java-kotlin' ]
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -47,11 +38,14 @@ jobs:
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- name: Set up environment for Android build
uses: ./.github/actions/prepare-env

- name: Build and install all
# working-directory: core
run: cd projects && ./install.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
15 changes: 2 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Set up environment for Android build
uses: ./.github/actions/prepare-env

- name: Install
run: cd projects && ./install.sh

- name: Release
run: cd projects && ./release.sh


14 changes: 2 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Set up environment for Android build
uses: ./.github/actions/prepare-env

- name: Install
run: cd projects && ./install.sh
Expand All @@ -49,4 +40,3 @@ jobs:
name: test-reports
path: |
'**/*/examples/android-perfs/build/reports/tests/testDebugUnitTest/'

15 changes: 2 additions & 13 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Set up environment for Android build
uses: ./.github/actions/prepare-env

- name: Install
run: cd projects && ./install.sh

- name: Benchmark
run: cd projects && ./benchmark.sh


Loading