-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add travis - set up package:mono_repo - add test to ffi/hello_world * fix typo * run dartfmt * don't run tests for certain FFI samples * update ffi/primitives sample for CI * update structs and system-command for Dart 2.6 * disable stable testing for FFI samples
- Loading branch information
Showing
27 changed files
with
506 additions
and
101 deletions.
There are no files selected for viewing
This file contains 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,132 @@ | ||
# Created with package:mono_repo v2.3.0 | ||
language: dart | ||
|
||
jobs: | ||
include: | ||
- stage: analyze | ||
name: "SDK: dev; PKG: ffi/hello_world; TASKS: `dartanalyzer .`" | ||
dart: dev | ||
os: linux | ||
env: PKGS="ffi/hello_world" | ||
script: ./tool/travis.sh dartanalyzer | ||
- stage: analyze | ||
name: "SDK: stable; PKG: ffi/hello_world; TASKS: `dartanalyzer .`" | ||
dart: stable | ||
os: linux | ||
env: PKGS="ffi/hello_world" | ||
script: ./tool/travis.sh dartanalyzer | ||
- stage: analyze | ||
name: "SDK: dev; PKG: ffi/hello_world; TASKS: `dartfmt -n --set-exit-if-changed .`" | ||
dart: dev | ||
os: linux | ||
env: PKGS="ffi/hello_world" | ||
script: ./tool/travis.sh dartfmt | ||
- stage: analyze | ||
name: "SDK: stable; PKG: ffi/hello_world; TASKS: `dartfmt -n --set-exit-if-changed .`" | ||
dart: stable | ||
os: linux | ||
env: PKGS="ffi/hello_world" | ||
script: ./tool/travis.sh dartfmt | ||
- stage: analyze | ||
name: "SDK: dev; PKG: ffi/primitives; TASKS: `dartanalyzer .`" | ||
dart: dev | ||
os: linux | ||
env: PKGS="ffi/primitives" | ||
script: ./tool/travis.sh dartanalyzer | ||
- stage: analyze | ||
name: "SDK: dev; PKG: ffi/primitives; TASKS: `dartfmt -n --set-exit-if-changed .`" | ||
dart: dev | ||
os: linux | ||
env: PKGS="ffi/primitives" | ||
script: ./tool/travis.sh dartfmt | ||
- stage: analyze | ||
name: "SDK: dev; PKG: ffi/structs; TASKS: `dartanalyzer .`" | ||
dart: dev | ||
os: linux | ||
env: PKGS="ffi/structs" | ||
script: ./tool/travis.sh dartanalyzer | ||
- stage: analyze | ||
name: "SDK: dev; PKG: ffi/structs; TASKS: `dartfmt -n --set-exit-if-changed .`" | ||
dart: dev | ||
os: linux | ||
env: PKGS="ffi/structs" | ||
script: ./tool/travis.sh dartfmt | ||
- stage: analyze | ||
name: "SDK: dev; PKG: ffi/system-command; TASKS: `dartanalyzer .`" | ||
dart: dev | ||
os: linux | ||
env: "PKGS=\"ffi/system-command\"" | ||
script: ./tool/travis.sh dartanalyzer | ||
- stage: analyze | ||
name: "SDK: dev; PKG: ffi/system-command; TASKS: `dartfmt -n --set-exit-if-changed .`" | ||
dart: dev | ||
os: linux | ||
env: "PKGS=\"ffi/system-command\"" | ||
script: ./tool/travis.sh dartfmt | ||
- stage: analyze | ||
name: "SDK: dev; PKG: native_app; TASKS: `dartanalyzer .`" | ||
dart: dev | ||
os: linux | ||
env: PKGS="native_app" | ||
script: ./tool/travis.sh dartanalyzer | ||
- stage: analyze | ||
name: "SDK: stable; PKG: native_app; TASKS: `dartanalyzer .`" | ||
dart: stable | ||
os: linux | ||
env: PKGS="native_app" | ||
script: ./tool/travis.sh dartanalyzer | ||
- stage: analyze | ||
name: "SDK: dev; PKG: native_app; TASKS: `dartfmt -n --set-exit-if-changed .`" | ||
dart: dev | ||
os: linux | ||
env: PKGS="native_app" | ||
script: ./tool/travis.sh dartfmt | ||
- stage: analyze | ||
name: "SDK: stable; PKG: native_app; TASKS: `dartfmt -n --set-exit-if-changed .`" | ||
dart: stable | ||
os: linux | ||
env: PKGS="native_app" | ||
script: ./tool/travis.sh dartfmt | ||
- stage: unit_test | ||
name: "SDK: dev; PKG: ffi/hello_world; TASKS: `pub run test`" | ||
dart: dev | ||
os: linux | ||
env: PKGS="ffi/hello_world" | ||
script: ./tool/travis.sh test | ||
- stage: unit_test | ||
name: "SDK: stable; PKG: ffi/hello_world; TASKS: `pub run test`" | ||
dart: stable | ||
os: linux | ||
env: PKGS="ffi/hello_world" | ||
script: ./tool/travis.sh test | ||
- stage: unit_test | ||
name: "SDK: dev; PKG: ffi/primitives; TASKS: `pub run test`" | ||
dart: dev | ||
os: linux | ||
env: PKGS="ffi/primitives" | ||
script: ./tool/travis.sh test | ||
- stage: unit_test | ||
name: "SDK: dev; PKG: native_app; TASKS: `pub run test`" | ||
dart: dev | ||
os: linux | ||
env: PKGS="native_app" | ||
script: ./tool/travis.sh test | ||
- stage: unit_test | ||
name: "SDK: stable; PKG: native_app; TASKS: `pub run test`" | ||
dart: stable | ||
os: linux | ||
env: PKGS="native_app" | ||
script: ./tool/travis.sh test | ||
|
||
stages: | ||
- analyze | ||
- unit_test | ||
|
||
# Only building master means that we don't run two builds for each pull request. | ||
branches: | ||
only: | ||
- master | ||
|
||
cache: | ||
directories: | ||
- "$HOME/.pub-cache" |
This file contains 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
This file contains 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,10 @@ | ||
FROM google/dart:2.6.0-dev.8.2 | ||
|
||
WORKDIR /app | ||
|
||
ADD pubspec.* /app/ | ||
RUN pub get | ||
COPY . /app | ||
RUN pub get --offline | ||
|
||
RUN apt-get update && apt-get install -y make gcc |
This file contains 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,8 @@ | ||
hello.o: hello.c | ||
gcc -c -fpic hello.c | ||
|
||
so: hello.o | ||
gcc -shared hello.o -o ../hello_world.so | ||
|
||
clean: | ||
rm -f hello.o ../hello_world.so |
This file contains 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
This file contains 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,10 @@ | ||
dart: | ||
- dev | ||
- stable | ||
|
||
stages: | ||
- analyze: | ||
- dartanalyzer | ||
- dartfmt | ||
- unit_test: | ||
- test |
This file contains 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,33 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:test/test.dart'; | ||
|
||
// These tests are Linux-only. For platform-specific instructions, see the | ||
// README. | ||
void main() async { | ||
group('hello_world', () { | ||
test('make dylib + execute', () async { | ||
// run 'make clean' | ||
var clean = await Process.run('make', ['-f', 'LinuxMakefile', 'clean'], | ||
workingDirectory: 'c'); | ||
expect(clean.exitCode, 0); | ||
|
||
// run 'make so' | ||
var dynamicLib = await Process.run('make', ['-f', 'LinuxMakefile', 'so'], | ||
workingDirectory: 'c'); | ||
expect(dynamicLib.exitCode, 0); | ||
|
||
// Verify dynamic library was created | ||
var file = File('./hello_world.so'); | ||
expect(await file.exists(), true); | ||
|
||
// Run the Dart script | ||
var dartProcess = await Process.run('dart', ['hello.dart']); | ||
expect(dartProcess.exitCode, equals(0)); | ||
|
||
// Verify program output | ||
expect(dartProcess.stderr, isEmpty); | ||
expect(dartProcess.stdout, equals('Hello World\n')); | ||
}); | ||
}); | ||
} |
This file contains 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,10 @@ | ||
FROM google/dart:2.6.0-dev.8.2 | ||
|
||
WORKDIR /app | ||
|
||
ADD pubspec.* /app/ | ||
RUN pub get | ||
COPY . /app | ||
RUN pub get --offline | ||
|
||
RUN apt-get update && apt-get install -y make gcc |
This file contains 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,8 @@ | ||
primitives.o: primitives.c | ||
gcc -c -fpic primitives.c | ||
|
||
so: primitives.o | ||
gcc -shared primitives.o -o ../primitives.so | ||
|
||
clean: | ||
rm -f a.out primitives.o ../primitives.so |
This file contains 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,9 @@ | ||
dart: | ||
- dev | ||
|
||
stages: | ||
- analyze: | ||
- dartanalyzer | ||
- dartfmt | ||
- unit_test: | ||
- test |
This file contains 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
This file contains 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
Oops, something went wrong.