Skip to content

Commit

Permalink
github: try building all apps before failing (#64)
Browse files Browse the repository at this point in the history
Build only updated apps
If no code was changed, build all
  • Loading branch information
hedger authored Oct 24, 2023
1 parent 9cb3984 commit 3be8245
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
50 changes: 44 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,64 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 2

- name: Set up ufbt
uses: flipperdevices/flipperzero-ufbt-action@v0.1.2
with:
sdk-channel: ${{ github.event.inputs.sdk-channel || 'rc'}}
task: setup

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
with:
dir_names: true
dir_names_max_depth: 1
dir_names_exclude_current_dir: true
files: |
!.*/**
- name: Build & lint updated apps
if: steps.changed-files.outputs.all_changed_and_modified_files != ''
run: |
BUILD_FAILED=0
for appdir in ${{ steps.changed-files.outputs.all_changed_and_modified_files }} ; do
echo "Building in $appdir"
pushd $appdir
if ! ufbt build faps ; then
echo "::error::Failed to build $appdir"
BUILD_FAILED=1
fi
popd
done
if [ $BUILD_FAILED -ne 0 ] ; then
echo One or more apps failed to build
exit 1
fi
- name: Build & lint all apps
if: steps.changed-files.outputs.all_changed_and_modified_files == ''
run: |
BUILD_FAILED=0
for appdir in $( dirname $( find . -name application.fam ) ) ; do
echo "Building in $appdir"
pushd $appdir
ufbt lint faps
if ! ufbt build faps ; then
BUILD_FAILED=1
echo "::error::Failed to build $appdir"
fi
popd
done
rm -rf dist || true && mkdir dist
for fapfile in $( find . -name "*.fap" ) ; do
cp $fapfile dist/
done
if [ $BUILD_FAILED -ne 0 ] ; then
echo One or more apps failed to build
exit 1
fi
- name: Gather build artifacts
run: |
mkdir -p dist
cp -v $( find . -name '*.fap' ) dist/
- name: Upload all .fap files
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ This repository contains Flipper Zero apps maintained by Flipper Zero Team and F

Same rules as for Flipper Zero Firmware. Details can be found [here](CONTRIBUTING.md).

In addition we accept socially important apps to this repository. So if you feel like you need our help in maintaining something important for community feel free to open Issue/PR.
In addition we accept socially important apps to this repository. So if you feel like you need our help in maintaining something important for community feel free to open Issue/PR.

0 comments on commit 3be8245

Please sign in to comment.