chore(shorebird_cli): run CI on Windows and Linux (#1873)
This commit is contained in:
@@ -80,9 +80,3 @@ runs:
|
||||
with:
|
||||
flags: ${{ steps.split.outputs.package_name }}
|
||||
token: ${{ inputs.codecov_token }}
|
||||
|
||||
- uses: VeryGoodOpenSource/very_good_coverage@v2
|
||||
with:
|
||||
path: ${{inputs.working_directory}}/coverage/lcov.info
|
||||
exclude: ${{inputs.coverage_excludes}}
|
||||
min_coverage: ${{inputs.min_coverage}}
|
||||
|
||||
@@ -19,6 +19,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
needs_cross_platform_dart_build: ${{ steps.needs_cross_platform_dart_build.outputs.changes }}
|
||||
needs_dart_build: ${{ steps.needs_dart_build.outputs.changes }}
|
||||
needs_redis_build: ${{ steps.needs_redis_build.outputs.changes }}
|
||||
needs_verify: ${{ steps.needs_verify.outputs.changes }}
|
||||
@@ -44,6 +45,12 @@ jobs:
|
||||
- ./.github/workflows/main.yaml
|
||||
- ./.github/actions/dart_package/action.yaml
|
||||
- packages/discord_gcp_alerts/**
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
name: Build Detection
|
||||
id: needs_cross_platform_dart_build
|
||||
with:
|
||||
filters: |
|
||||
shorebird_cli:
|
||||
- ./.github/codecov.yml
|
||||
- ./.github/workflows/main.yaml
|
||||
@@ -122,6 +129,29 @@ jobs:
|
||||
codecov_token: ${{ secrets.CODECOV_TOKEN }}
|
||||
working_directory: packages/${{ matrix.package }}
|
||||
|
||||
build_cross_platform_dart_packages:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.needs_cross_platform_dart_build != '[]' }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
package: ${{ fromJSON(needs.changes.outputs.needs_cross_platform_dart_build) }}
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
name: 🎯 Build ${{ matrix.package }} (${{ matrix.os }})
|
||||
|
||||
steps:
|
||||
- name: 📚 Git Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🎯 Build ${{ matrix.package }}
|
||||
uses: ./.github/actions/dart_package
|
||||
with:
|
||||
codecov_token: ${{ secrets.CODECOV_TOKEN }}
|
||||
working_directory: packages/${{ matrix.package }}
|
||||
|
||||
build_redis:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.needs_redis_build != '[]' }}
|
||||
@@ -174,7 +204,13 @@ jobs:
|
||||
|
||||
ci:
|
||||
needs:
|
||||
[semantic_pull_request, build_dart_packages, build_redis, verify_packages]
|
||||
[
|
||||
semantic_pull_request,
|
||||
build_cross_platform_dart_packages,
|
||||
build_dart_packages,
|
||||
build_redis,
|
||||
verify_packages,
|
||||
]
|
||||
if: ${{ always() }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -2,6 +2,15 @@
|
||||
# curl -X POST --data-binary @codecov.yml https://codecov.io/validate
|
||||
# See https://docs.codecov.com/docs/flags
|
||||
|
||||
coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
target: 100%
|
||||
patch:
|
||||
default:
|
||||
target: 100%
|
||||
|
||||
# Packages in third_party don't have 100% coverage, which shouldn't prevent
|
||||
# us from landing. Ideally, this would be configured to allow a non-100% base
|
||||
# and enforce that all changes have 100% coverage of affected lines.
|
||||
|
||||
@@ -137,9 +137,7 @@ class IosArchiveDiffer extends ArchiveDiffer {
|
||||
final assetInfoPath = '$outPath.json';
|
||||
|
||||
if (Platform.isMacOS) {
|
||||
// coverage:ignore-start
|
||||
Process.runSync('assetutil', ['--info', outPath, '-o', assetInfoPath]);
|
||||
// coverage:ignore-end
|
||||
} else {
|
||||
// This is just for testing
|
||||
File(assetInfoPath).createSync(recursive: true);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1087
-1076
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+509
-503
File diff suppressed because it is too large
Load Diff
@@ -54,13 +54,13 @@ void main() {
|
||||
});
|
||||
|
||||
group('link', () {
|
||||
const base = './path/to/base.aot';
|
||||
const patch = './path/to/patch.aot';
|
||||
const analyzeSnapshot = './path/to/analyze_snapshot';
|
||||
const genSnapshot = './path/to/gen_snapshot';
|
||||
const kernel = './path/to/kernel.dill';
|
||||
const outputPath = './path/to/out.vmcode';
|
||||
const linkJsonPath = './path/to/link.jsonl';
|
||||
final base = p.join('.', 'path', 'to', 'base.aot');
|
||||
final patch = p.join('.', 'path', 'to', 'patch.aot');
|
||||
final analyzeSnapshot = p.join('.', 'path', 'to', 'analyze_snapshot');
|
||||
final genSnapshot = p.join('.', 'path', 'to', 'gen_snapshot');
|
||||
final kernel = p.join('.', 'path', 'to', 'kernel.dill');
|
||||
final outputPath = p.join('.', 'path', 'to', 'out.vmcode');
|
||||
final linkJsonPath = p.join('.', 'path', 'to', 'link.jsonl');
|
||||
|
||||
test('throws Exception when process exits with non-zero code', () async {
|
||||
when(
|
||||
|
||||
@@ -51,35 +51,47 @@ void main() {
|
||||
});
|
||||
|
||||
group('executable', () {
|
||||
group('when on Windows', () {
|
||||
const javaHome = r'C:\Program Files\Java\jdk-11.0.1';
|
||||
setUp(() {
|
||||
when(() => platform.isWindows).thenReturn(true);
|
||||
when(() => platform.environment).thenReturn({'JAVA_HOME': javaHome});
|
||||
});
|
||||
group(
|
||||
'when on Windows',
|
||||
() {
|
||||
const javaHome = r'C:\Program Files\Java\jdk-11.0.1';
|
||||
setUp(() {
|
||||
when(() => platform.isWindows).thenReturn(true);
|
||||
when(() => platform.environment)
|
||||
.thenReturn({'JAVA_HOME': javaHome});
|
||||
});
|
||||
|
||||
test('returns correct executable on windows', () async {
|
||||
expect(
|
||||
runWithOverrides(() => java.executable),
|
||||
equals(p.join(javaHome, 'bin', 'java.exe')),
|
||||
);
|
||||
});
|
||||
});
|
||||
test('returns correct executable on windows', () async {
|
||||
expect(
|
||||
runWithOverrides(() => java.executable),
|
||||
equals(p.join(javaHome, 'bin', 'java.exe')),
|
||||
);
|
||||
});
|
||||
},
|
||||
testOn: 'windows',
|
||||
);
|
||||
|
||||
group('when on a non-Windows OS', () {
|
||||
setUp(() {
|
||||
const javaHome = '/path/to/jdk';
|
||||
when(() => platform.isWindows).thenReturn(false);
|
||||
when(() => platform.environment).thenReturn({'JAVA_HOME': javaHome});
|
||||
});
|
||||
group(
|
||||
'when on a non-Windows OS',
|
||||
() {
|
||||
setUp(() {
|
||||
const javaHome = '/path/to/jdk';
|
||||
when(() => platform.isWindows).thenReturn(false);
|
||||
when(() => platform.environment)
|
||||
.thenReturn({'JAVA_HOME': javaHome});
|
||||
});
|
||||
|
||||
test('returns correct executable on non-windows', () async {
|
||||
expect(
|
||||
runWithOverrides(() => java.executable),
|
||||
equals('/path/to/jdk/bin/java'),
|
||||
);
|
||||
});
|
||||
});
|
||||
test('returns correct executable on non-windows', () async {
|
||||
expect(
|
||||
runWithOverrides(() => java.executable),
|
||||
equals('/path/to/jdk/bin/java'),
|
||||
);
|
||||
});
|
||||
},
|
||||
onPlatform: {
|
||||
'windows': const Skip(),
|
||||
},
|
||||
);
|
||||
|
||||
group('when no jdk is found', () {
|
||||
setUp(() {
|
||||
|
||||
@@ -199,8 +199,8 @@ void main() {
|
||||
);
|
||||
|
||||
test('adds local-engine arguments if set', () async {
|
||||
engineConfig = const EngineConfig(
|
||||
localEngineSrcPath: 'path/to/engine/src',
|
||||
engineConfig = EngineConfig(
|
||||
localEngineSrcPath: p.join('path', 'to', 'engine', 'src'),
|
||||
localEngine: 'android_release_arm64',
|
||||
localEngineHost: 'host_release',
|
||||
);
|
||||
|
||||
+6
-6
@@ -149,10 +149,10 @@ void main() {
|
||||
expect(
|
||||
results.first,
|
||||
equals(
|
||||
const ValidationIssue(
|
||||
ValidationIssue(
|
||||
severity: ValidationIssueSeverity.error,
|
||||
message:
|
||||
'''android/app/src/main/AndroidManifest.xml is missing the INTERNET permission.''',
|
||||
'''${p.join('android', 'app', 'src', 'main', 'AndroidManifest.xml')} is missing the INTERNET permission.''',
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -179,10 +179,10 @@ void main() {
|
||||
expect(
|
||||
results.first,
|
||||
equals(
|
||||
const ValidationIssue(
|
||||
ValidationIssue(
|
||||
severity: ValidationIssueSeverity.error,
|
||||
message:
|
||||
'''android/app/src/main/AndroidManifest.xml is missing the INTERNET permission.''',
|
||||
'''${p.join('android', 'app', 'src', 'main', 'AndroidManifest.xml')} is missing the INTERNET permission.''',
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -212,10 +212,10 @@ void main() {
|
||||
expect(
|
||||
results.first,
|
||||
equals(
|
||||
const ValidationIssue(
|
||||
ValidationIssue(
|
||||
severity: ValidationIssueSeverity.error,
|
||||
message:
|
||||
'''android/app/src/main/AndroidManifest.xml is missing the INTERNET permission.''',
|
||||
'''${p.join('android', 'app', 'src', 'main', 'AndroidManifest.xml')} is missing the INTERNET permission.''',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user