-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 8ff5d8c into ci-optimization-deps_no_smithy
- Loading branch information
Showing
10 changed files
with
450 additions
and
147 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,82 @@ | ||
name: Unit test coverage | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
sdk: | ||
required: true | ||
type: string | ||
previous_commit_sha: | ||
required: true | ||
type: string | ||
use_cached_coverage: | ||
required: true | ||
type: boolean | ||
|
||
jobs: | ||
test-ddc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: ${{ inputs.sdk }} | ||
|
||
- name: Run Tests (DDC + coverage) | ||
if: ${{ !inputs.use_cached_coverage }} | ||
run: dart run dart_dev test --test-args="--coverage=reports/coverage" -P dartdevc | ||
|
||
- name: Upload New Coverage Data | ||
if: ${{ !inputs.use_cached_coverage }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage | ||
path: reports/coverage | ||
|
||
generate-coverage: | ||
runs-on: ubuntu-latest | ||
needs: [ test-ddc ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: ${{ inputs.sdk }} | ||
- name: Download Package Config | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: package_config@${{ inputs.sdk }} | ||
path: .dart_tool | ||
|
||
- name: Download New Coverage Data | ||
if: ${{ !inputs.use_cached_coverage }} | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: coverage | ||
path: reports/coverage | ||
|
||
- name: Download Cached Coverage Data | ||
if: ${{ inputs.use_cached_coverage }} | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
reports/coverage | ||
key: coverage@${{ inputs.previous_commit_sha }} | ||
|
||
- name: Activate Coverage Package | ||
run: dart pub global activate coverage | ||
|
||
- name: Format Coverage | ||
run: dart pub global run coverage:format_coverage --packages=.dart_tool/package_config.json --report-on=lib --lcov -o reports/coverage/lcov.info -i reports/coverage | ||
|
||
- name: Cache Coverage Data | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
reports/coverage | ||
key: coverage@${{ github.sha }} | ||
|
||
- name: Report Coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: reports/coverage/lcov.info |
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,50 @@ | ||
name: Shared install / pub cache job | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
sdk: | ||
required: true | ||
type: string | ||
store_package_config: | ||
required: false | ||
default: false | ||
type: boolean | ||
store_lockfile: | ||
required: true | ||
type: boolean | ||
|
||
jobs: | ||
pub-get: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: ${{ inputs.sdk }} | ||
|
||
- name: Check pub cache | ||
id: cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: .dart_tool | ||
key: ${{ runner.os }};${{ hashFiles('**/pubspec.yaml','**/pubspec.lock') || 'none' }}@${{ inputs.sdk }} | ||
|
||
- id: install | ||
name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Upload pubspec.lock | ||
if: ${{ inputs.store_lockfile }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pubspec.lock@${{ inputs.sdk }} | ||
path: pubspec.lock | ||
|
||
- name: Upload Package Config | ||
if: ${{ inputs.store_package_config }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: package_config@${{ inputs.sdk }} | ||
path: .dart_tool/package_config.json | ||
retention-days: 1 |
Oops, something went wrong.