Skip to content

Commit

Permalink
Merge branch 'release/0.1.0-alpha.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein committed Jan 26, 2022
2 parents 375d251 + 6f1b76f commit 1373090
Show file tree
Hide file tree
Showing 187 changed files with 8,404 additions and 1 deletion.
156 changes: 156 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Build and Test
on: [push, pull_request]
jobs:
build:
name: Run unit tests
runs-on: ubuntu-latest
strategy:
matrix:
flutter: ['2.8.0']
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
flutter-version: ${{ matrix.flutter }}
channel: 'stable'
- run: flutter pub get
- run: flutter test

analyze:
name: Analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.8.0'
channel: 'stable'
- run: flutter pub get
- run: flutter analyze
- run: flutter format -n --set-exit-if-changed .

build-android:
name: Integration tests on Android
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "11.x"

# -- Micro --
- name: Cache Micro
id: cache-micro
uses: actions/cache@v2
with:
path: micro.jar
key: ${{ runner.os }}-micro

- name: Get micro
if: steps.cache-micro.outputs.cache-hit != 'true'
run: curl -o micro.jar -L https://github.com/snowplow-incubator/snowplow-micro/releases/download/micro-1.1.2/snowplow-micro-1.1.2.jar

- name: Run Micro in background
run: java -jar micro.jar --collector-config example/tool/micro.conf --iglu example/tool/iglu.json &

- name: Wait on Micro endpoint
timeout-minutes: 2
run: while ! nc -z '0.0.0.0' 9090; do sleep 1; done

# -- Integration tests --
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.8.0'
channel: 'stable'

- name: Run Flutter Driver tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
target: default
arch: x86_64
profile: Nexus 6
working-directory: example
script: ./tool/e2e_tests.sh http://10.0.2.2:9090

build-ios:
name: Integration tests on iOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

# -- Micro --
- name: Cache Micro
id: cache-micro
uses: actions/cache@v2
with:
path: micro.jar
key: ${{ runner.os }}-micro

- name: Get micro
if: steps.cache-micro.outputs.cache-hit != 'true'
run: curl -o micro.jar -L https://github.com/snowplow-incubator/snowplow-micro/releases/download/micro-1.1.2/snowplow-micro-1.1.2.jar

- name: Run Micro in background
run: java -jar micro.jar --collector-config example/tool/micro.conf --iglu example/tool/iglu.json &

- name: Wait on Micro endpoint
timeout-minutes: 2
run: while ! nc -z '0.0.0.0' 9090; do sleep 1; done

# -- Integration tests --
- name: "Start Simulator"
uses: futureware-tech/simulator-action@v1
with:
model: iPhone 13
erase_before_boot: true
shutdown_after_job: true

- uses: subosito/flutter-action@v1
with:
flutter-version: '2.8.0'
channel: 'stable'

- run: "flutter clean"

- name: Run tests
working-directory: example
run: ./tool/e2e_tests.sh http://0.0.0.0:9090

build-web:
name: Integration tests on Web
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

# -- Micro --
- name: Cache Micro
id: cache-micro
uses: actions/cache@v2
with:
path: micro.jar
key: ${{ runner.os }}-micro

- name: Get micro
if: steps.cache-micro.outputs.cache-hit != 'true'
run: curl -o micro.jar -L https://github.com/snowplow-incubator/snowplow-micro/releases/download/micro-1.1.2/snowplow-micro-1.1.2.jar

- name: Run Micro in background
run: java -jar micro.jar --collector-config example/tool/micro.conf --iglu example/tool/iglu.json &

- name: Wait on Micro endpoint
timeout-minutes: 2
run: while ! nc -z '0.0.0.0' 9090; do sleep 1; done

# -- Integration tests --
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.8.0'
channel: 'stable'

- run: chromedriver --port=4444 &

- name: Run tests
working-directory: example
run: ./tool/e2e_tests.sh http://0.0.0.0:9090 "-d web-server"
101 changes: 101 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Publish package to pub.dev and make a GitHub release

on:
push:
tags:
- '*.*.*'

jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest
strategy:
matrix:
flutter: ['2.8.0']
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
flutter-version: ${{ matrix.flutter }}
channel: 'stable'
- run: flutter pub get
- run: flutter test

version_check:
runs-on: ubuntu-latest
outputs:
v_tracker: ${{ steps.version.outputs.FLUTTER_TRACKER_VERSION}}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 14

- name: Get tag and tracker versions
id: version
env:
IOS_VER_FILEPATH: 'ios/Classes/TrackerVersion.swift'
ANDR_VER_FILEPATH: 'android/src/main/kotlin/com/snowplowanalytics/snowplow_tracker/TrackerVersion.kt'
run: |
echo ::set-output name=TAG_VERSION::${GITHUB_REF#refs/*/}
echo "##[set-output name=FLUTTER_TRACKER_VERSION;]$(cat pubspec.yaml | sed -n -e 's/^.*version: \(.*\)/\1/p')"
echo "##[set-output name=FLUTTER_IOS_TRACKER_VERSION;]$(cat "${IOS_VER_FILEPATH}" | sed -n -e 's/^.*TRACKER_VERSION = "flutter-\(.*\)"/\1/p')"
echo "##[set-output name=FLUTTER_ANDROID_TRACKER_VERSION;]$(cat "${ANDR_VER_FILEPATH}" | sed -n -e 's/^.*TRACKER_VERSION = "flutter-\(.*\)"/\1/p')"
- name: Fail if version mismatch
run: |
if [ "${{ steps.version.outputs.TAG_VERSION }}" != "${{ steps.version.outputs.FLUTTER_TRACKER_VERSION }}" ] ; then
echo "Tag version (${{ steps.version.outputs.TAG_VERSION }}) doesn't match version in project (${{ steps.version.outputs.FLUTTER_TRACKER_VERSION }})"
exit 1
fi
if [ "${{ steps.version.outputs.TAG_VERSION }}" != "${{ steps.version.outputs.FLUTTER_IOS_TRACKER_VERSION }}" ] ; then
echo "Tag version (${{ steps.version.outputs.TAG_VERSION }}) doesn't match version in project(ios) (${{ steps.version.outputs.FLUTTER_IOS_TRACKER_VERSION }})"
exit 1
fi
if [ "${{ steps.version.outputs.TAG_VERSION }}" != "${{ steps.version.outputs.FLUTTER_ANDROID_TRACKER_VERSION }}" ] ; then
echo "Tag version (${{ steps.version.outputs.TAG_VERSION }}) doesn't match version in project(android) (${{ steps.version.outputs.FLUTTER_ANDROID_TRACKER_VERSION }})"
exit 1
fi
publish_pubdev:
needs: ["test", "version_check"]
runs-on: ubuntu-latest
container:
image: google/dart:latest
steps:
- uses: actions/checkout@v1
- name: Setup credentials
run: |
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/credentials.json
{
"accessToken":"${{ secrets.ACCESS_TOKEN }}",
"refreshToken":"${{ secrets.REFRESH_TOKEN }}",
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
"expiration": 1643122520446
}
EOF
- name: Publish package
run: pub publish -f

release:
needs: ["test", "publish_pubdev", "version_check"]
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Release
uses: softprops/action-gh-release@v0.1.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: Version ${{ needs.version_check.outputs.v_tracker }}
draft: false
prerelease: ${{ contains(needs.version_check.outputs.v_tracker, '-') }}
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/
10 changes: 10 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b
channel: stable

project_type: plugin
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Example App",
"program": "example/lib/main.dart",
"request": "launch",
"type": "dart",
"args":[
"--dart-define=ENDPOINT=http://192.168.100.127:9090"
]
}
]
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 0.1.0-alpha.1

* Add action to publish release to pub.dev and GitHub (#3)

# 0.1.0-dev.1

* Initial pre-release.
Loading

0 comments on commit 1373090

Please sign in to comment.