-
Notifications
You must be signed in to change notification settings - Fork 277
108 lines (94 loc) · 3.65 KB
/
dart_native.yaml
File metadata and controls
108 lines (94 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Native Test runs code on non-Linux platforms
name: Dart (Native)
on:
workflow_call:
inputs:
package-name:
description: The name of the package being tested
required: true
type: string
working-directory:
description: The working directory relative to the repo root
required: true
type: string
jobs:
test-dart-native:
timeout-minutes: 60
strategy:
# Allows other matrix items to run if one fails
fail-fast: false
matrix:
os:
# TODO(equartey): Change to `macos-latest` after github migrates their runners - https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
- macos-14
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Cache Pub dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # 4.2.4
with:
path: |
~/.pub-cache/hosted
~/.pub-cache/git
key: os:${{ matrix.os }};sdk:stable;packages:${{ inputs.working-directory }}
restore-keys: |
os:${{ matrix.os }};sdk:stable;packages:${{ inputs.working-directory }}
os:${{ matrix.os }};sdk:stable
os:${{ matrix.os }}
# Needed on Windows
- name: Enable Long Git Paths
run: git config --system core.longpaths true
- name: Git Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # 4.0.0
- name: Git Submodules
run: git submodule update --init
- name: Setup Dart
uses: dart-lang/setup-dart@fe21d53e1e27c70b5c8e8273d4bcc0d23c071577 # main
with:
sdk: stable
- name: Setup aft
shell: bash # Run in bash regardless of platform
run: dart pub global activate -spath packages/aft
# This is needed to support running tests which depend on db_common.
- name: Install SQLite
if: runner.os == 'Windows'
run: |
# Should match `packages/common/amplify_db_common/windows/CMakeLists.txt`
$uri = "https://www.sqlite.org/2022/sqlite-dll-win64-x64-3400000.zip"
$outFile = "sqlite.zip"
$out = ".\sqlite"
Invoke-WebRequest -Uri $uri -OutFile $outFile
Expand-Archive -LiteralPath $outFile -DestinationPath $out
$absoluteOut = Resolve-Path -Path $out
Add-Content $env:GITHUB_PATH $absoluteOut
Get-Content $env:GITHUB_PATH
- name: Bootstrap
id: bootstrap
timeout-minutes: 20
run: aft bootstrap --fail-fast --include=${{ inputs.package-name }} --verbose
- name: Setup Package
if: "always() && steps.bootstrap.conclusion == 'success'"
shell: bash # Run in bash regardless of platform
working-directory: ${{ inputs.working-directory }}
run: |
if [ -e tool/setup.sh ]; then
./tool/setup.sh
fi
- name: Run Tests
if: "always() && steps.bootstrap.conclusion == 'success'"
run: dart test --exclude-tags=build
working-directory: ${{ inputs.working-directory }}
- name: Log success/failure
if: always()
uses: ./.github/composite_actions/log_cw_metric_wrapper
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
job-status: ${{ job.status }}
github-token: ${{ secrets.GITHUB_TOKEN }}
test-type: unit
working-directory: ${{ inputs.working-directory }}
framework: dart
flutter-dart-channel: ${{ matrix.sdk }}
dart-compiler: native
platform-version: ${{ matrix.os }}