-
Notifications
You must be signed in to change notification settings - Fork 24
Add GitHub actions for CI/CD #14
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2d2bfd1
adds CI/CD for mediapipe_core
craiglabenz dcd8e05
add newlines
craiglabenz 28f0c1e
moves file into workflows dir
craiglabenz 12a53b5
uncomment flutter doctor
craiglabenz ac70f6a
testing PR config to run this now
craiglabenz 210584b
added master and beta CI scripts
craiglabenz 1897c10
add executable permissions to CI scripts
craiglabenz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Main Branch CI | ||
|
||
# Declare default permissions as read only. | ||
permissions: read-all | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main, ffi-wrapper-core-pkg] | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * *" # Every day at midnight | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
flutter-tests: | ||
name: Test mediapipe_core against ${{ matrix.flutter_version }} | ||
runs-on: ${{ matrix.os }} | ||
# Skip running job on forks | ||
if: github.repository == 'google/flutter-mediapipe' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
flutter_version: [stable, beta, master] | ||
# TODO(craiglabenz): Add `ubuntu-latest` and `windows-latest` when those artifacts exist | ||
os: [macos-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: ${{ matrix.flutter_version }} | ||
- run: ./tool/mediapipe_ci_script_${{ matrix.flutter_version }}.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
function ci_package () { | ||
local channel="$1" | ||
|
||
shift | ||
local arr=("$@") | ||
for PACKAGE_NAME in "${arr[@]}" | ||
do | ||
echo "== Testing '${PACKAGE_NAME}' on Flutter's $channel channel ==" | ||
pushd "packages/${PACKAGE_NAME}" | ||
|
||
# Grab packages. | ||
flutter pub get | ||
|
||
# Run the analyzer to find any static analysis issues. | ||
dart analyze --fatal-infos | ||
|
||
# Run the formatter on all the dart files to make sure everything's linted. | ||
dart format --output none --set-exit-if-changed . | ||
|
||
# Run the actual tests. | ||
if [ -d "test" ] | ||
then | ||
flutter test | ||
fi | ||
|
||
popd | ||
done | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
DIR="${BASH_SOURCE%/*}" | ||
source "$DIR/ci_script_shared.sh" | ||
|
||
flutter doctor -v | ||
|
||
declare -ar PACKAGE_NAMES=( | ||
"mediapipe-core" | ||
) | ||
|
||
ci_package "beta" "${PACKAGE_NAMES[@]}" | ||
|
||
echo "-- Success --" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
DIR="${BASH_SOURCE%/*}" | ||
source "$DIR/ci_script_shared.sh" | ||
|
||
flutter doctor -v | ||
|
||
declare -ar PACKAGE_NAMES=( | ||
"mediapipe-core" | ||
) | ||
|
||
ci_package "master" "${PACKAGE_NAMES[@]}" | ||
|
||
echo "-- Success --" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
DIR="${BASH_SOURCE%/*}" | ||
source "$DIR/ci_script_shared.sh" | ||
|
||
flutter doctor -v | ||
|
||
declare -ar PACKAGE_NAMES=( | ||
"mediapipe-core" | ||
) | ||
|
||
ci_package "stable" "${PACKAGE_NAMES[@]}" | ||
|
||
echo "-- Success --" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add NL at EOF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd be so proud of me. I saw those as I was opening the PR, added the newlines, forgot to stage my changes, committed nothing, and force-pushed. Yay!