Skip to content

Commit

Permalink
Merge pull request #143 from osociety/test-linux-folder-only
Browse files Browse the repository at this point in the history
Test linux build runs on respective folder
  • Loading branch information
git-elliot authored Mar 24, 2024
2 parents 8bf8e71 + 79f8521 commit fc0b78e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ jobs:
# Set job outputs to values from filter step
outputs:
lib: ${{ steps.filter.outputs.lib }}
android: ${{ steps.filter.outputs.android }}
test: ${{ steps.filter.outputs.test }}
android: ${{ steps.filter.outputs.android }}
linux: ${{ steps.filter.outputs.linux }}
macos: ${{ steps.filter.outputs.macos }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v3
Expand All @@ -39,7 +41,7 @@ jobs:
- 'macos/**'
android-linux-build:
name: 'Flutter Android and Linux Build'
name: 'Android / Linux Build'
needs: changes
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -92,6 +94,11 @@ jobs:
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true'}}
run: |
flutter build apk --debug --flavor dev
# Run only if test, lib, and linux folder is changed
- name: Install Linux dependencies
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true'}}
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
- name: Build Linux
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true'}}
run: flutter build linux
2 changes: 1 addition & 1 deletion linux/main.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "my_application.h"

// main func
int main(int argc, char** argv) {
g_autoptr(MyApplication) app = my_application_new();
return g_application_run(G_APPLICATION(app), argc, argv);
Expand Down

0 comments on commit fc0b78e

Please sign in to comment.