From 32a8e29af71d4d3e550dba17e832e80c25582fed Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Fri, 8 Nov 2024 15:08:57 +0100 Subject: [PATCH] cache in ci --- .github/workflows/integration-test.yml | 5 ++++- test/integration_test.dart | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index f77e0ee..9e98275 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -39,6 +39,9 @@ jobs: distribution: 'temurin' java-version: '17' - - run: env + - uses: actions/cache@v4 + with: + path: temp/testapp-${{ matrix.target }} + key: integration-test-${{ matrix.host }}-${{ matrix.target }} - run: dart test --tags integration diff --git a/test/integration_test.dart b/test/integration_test.dart index 6527891..f518f9a 100644 --- a/test/integration_test.dart +++ b/test/integration_test.dart @@ -12,6 +12,19 @@ import 'package:test/test.dart'; const appName = 'testapp'; late final String serverUri; +// Platforms to be tested are either coming from the CI env var or +// we test everything that is possible to test on this machine. +final testPlatforms = Platform.environment.containsKey('TEST_PLATFORM') + ? [Platform.environment['TEST_PLATFORM']!] + : [ + 'android', + if (Platform.isMacOS) 'macos', + if (Platform.isMacOS) 'ios', + if (Platform.isWindows) 'windows', + if (Platform.isLinux) 'linux', + 'web' + ]; + // NOTE: Don't run/debug this main(), it likely won't work. // You can use main() in `sentry_native_test.dart`. void main() async { @@ -21,19 +34,6 @@ void main() async { : Directory.current; final tempDir = Directory('${repoRootDir.path}/temp'); - // Platforms to be tested are either coming from the CI env var or - // we test everything that is possible to test on this machine. - final testPlatforms = bool.hasEnvironment('TEST_PLATFORM') - ? [String.fromEnvironment('TEST_PLATFORM')] - : [ - 'android', - if (Platform.isMacOS) 'macos', - if (Platform.isMacOS) 'ios', - if (Platform.isWindows) 'windows', - if (Platform.isLinux) 'linux', - 'web' - ]; - late Process testServer; late Future> Function() stopServer; setUp(() async {