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

improve github action setup #4718

Merged
merged 3 commits into from
Oct 10, 2024
Merged
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
18 changes: 18 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Setup build environment'
description: 'Sets up an environment for building Tusky'
runs:
using: "composite"
steps:
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Copy CI gradle.properties
shell: bash
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Gradle Build Action
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
14 changes: 2 additions & 12 deletions .github/workflows/check-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Gradle Build Action
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
- name: Setup
uses: ./.github/actions/setup

- name: ktlint
run: ./gradlew clean ktlintCheck
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ on:
- '*'

jobs:
build:
check-and-build:
uses: ./.github/workflows/check-and-build.yml
deploy:
runs-on: ubuntu-latest
needs: check-and-build
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ./.github/workflows/check-and-build.yml
- name: Setup
uses: ./.github/actions/setup

- name: Build Blue aab
run: ./gradlew app:bundleBlueRelease
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ on:
- develop

jobs:
build:
check-and-build:
uses: ./.github/workflows/check-and-build.yml
deploy:
runs-on: ubuntu-latest
needs: check-and-build
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ./.github/workflows/check-and-build.yml
- name: Setup
uses: ./.github/actions/setup

- name: Build Green aab
run: ./gradlew app:bundleGreenRelease
Expand Down