Skip to content

Commit

Permalink
Add CI job to build APK (#121)
Browse files Browse the repository at this point in the history
* Add build apk CI step

* Move the build apk step after the tests

Because it takes a long time, it's better to run the tests first to fail
 fast.

* Cache the sdk

* Cache the gradle directory as well

* Use newer version of cache action

* Use absolute path

* Be more explicit with what is being cached

* Test not caching the licenses sdk directory

* List licences before and after

* Don't cache the android sdk tools

* Move apk build into a separate workflow

* Update action versions

* Run the build_executables workflow on all pull requests

* Build profile apks

* Rename build_and_test workflow to test
  • Loading branch information
Abestanis authored Jun 27, 2024
1 parent b96a5ee commit 49046ab
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 8 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build_executables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build Sweyer executables
on:
pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@v4

- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.7.12
channel: stable
cache: true

- name: πŸ“¦ Install Dependencies
shell: bash
run: |
flutter pub global activate very_good_cli
very_good --analytics false
very_good packages get --recursive
- name: πŸ’Ύ Cache Gradle
uses: actions/cache@v4
with:
key: gradle
path: /home/runner/.gradle

- name: πŸ”¨ Build Apk
shell: bash
run: flutter build apk --profile

- name: πŸ“ Save executables
uses: actions/upload-artifact@v4
with:
name: Android Apk
path: build/app/outputs/flutter-apk/app-profile.apk
4 changes: 2 additions & 2 deletions .github/workflows/sweyer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
- name: πŸ“š Git Checkout
uses: actions/checkout@v3

- name: πŸ— Build and test Sweyer
uses: ./.github/workflows/build_and_test
- name: πŸ§ͺ Test Sweyer
uses: ./.github/workflows/test
with:
testing_arguments: --coverage

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sweyer_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
- name: πŸ“š Git Checkout
uses: actions/checkout@v3

- name: πŸ— Build and test Sweyer
- name: πŸ§ͺ Test Sweyer
if: ${{ github.event.inputs.skip-tests == 'false' }}
uses: ./.github/workflows/build_and_test
uses: ./.github/workflows/test
with:
testing_arguments: --coverage

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Modified very_good_workflows workflow, see ThirdPartyNotices.txt for license
# https://github.com/VeryGoodOpenSource/very_good_workflows/blob/c66b5434b3428fb5c3d5101492f173b206821850/.github/workflows/flutter_package.yml

name: πŸ— Build and test Sweyer
description: Build Sweyer and then test it.
name: πŸ§ͺ Test Sweyer
description: Run the Sweyer tests.

inputs:
flutter_channel:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update_goldens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
- name: πŸ“š Git Checkout
uses: actions/checkout@v3

- name: πŸ— Build and test Sweyer
uses: ./.github/workflows/build_and_test
- name: πŸ§ͺ Test Sweyer
uses: ./.github/workflows/test
with:
testing_arguments: --update-goldens

Expand Down

0 comments on commit 49046ab

Please sign in to comment.