diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 00000000..8703198d --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,15 @@ + +name: "Setup Worflow" + + +jobs: + using: "composite" + steps: + + - name: ๐Ÿงฑ Set Up JDK + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Grant Gradlew rights + run: chmod +x gradlew \ No newline at end of file diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index d09c4a58..e1c34a94 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -7,31 +7,22 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: ๐Ÿงฑ Set Up JDK - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: Grant Gradlew rights - run: chmod +x gradlew + - uses: actions/checkout@v3 + + - name: Setting up project + uses: ./.github/actions/setup + + - name: ๐Ÿ›  Build Project with Spotless Check + run: ./gradlew spotlessCheck - name: ๐Ÿงช Run Tests run: ./gradlew test - - name: ๐Ÿ›  Build Project with Spotless Check - run: ./gradlew spotlessCheck - - - name: โณ Build with Gradle - run: ./gradlew build - - name: ๐Ÿ— Build APK - run: bash ./gradlew assembleProductionDebug --stacktrace + run: bash ./gradlew assembleProductionDebug - name: ๐Ÿš€ Upload APK ๐Ÿ“ฑ uses: actions/upload-artifact@v2 diff --git a/.github/workflows/master-apk-create.yml b/.github/workflows/master-apk-create.yml index 5d160c77..3a74b4af 100644 --- a/.github/workflows/master-apk-create.yml +++ b/.github/workflows/master-apk-create.yml @@ -7,20 +7,12 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'temurin' - cache: gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew + - uses: actions/checkout@v3 + + - name: Setting up project + uses: ./.github/actions/setup - name: Build APK โš™๏ธ๐Ÿ›  run: bash ./gradlew assembleStagingDebug @@ -32,4 +24,3 @@ jobs: prerelease: true title: "Staging Build" files: app/build/outputs/apk/staging/debug/*.apk - diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 62e17d93..ec439050 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -9,35 +9,13 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - - name: Cache - uses: actions/cache@v2.1.6 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- - - - name: Checkout - uses: actions/checkout@v2 - - - name: set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: Grant rights - run: chmod +x build.gradle - - - - name: Grant Gradlew rights - run: chmod +x gradlew + - uses: actions/checkout@v3 + + - name: Setting up project + uses: ./.github/actions/setup - name: Build with Gradle id: build