Skip to content

Commit

Permalink
update the CI workflow to test the generation script (#112)
Browse files Browse the repository at this point in the history
update the CI workflow to test the generation script
  • Loading branch information
devoncarew authored Dec 1, 2023
1 parent cffc2e3 commit 865aeaf
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates

version: 2

updates:
- package-ecosystem: github-actions
directory: /
Expand Down
43 changes: 29 additions & 14 deletions .github/workflows/test-package.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches: [ main ]
schedule:
# Run nightly.
- cron: "0 0 * * 0"

env:
Expand All @@ -20,14 +21,12 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: [main]
flavor: [raw]
sdk: [stable]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
with:
sdk: ${{ matrix.sdk }}
flavor: ${{ matrix.flavor }}
- id: install
name: Install dependencies
run: dart pub get
Expand All @@ -38,29 +37,45 @@ jobs:
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

# Run tests on a matrix consisting of three dimensions:
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
# 2. release channel: main, dev
# 3. flavor: raw
# Run tests on a matrix of several SDK releases.
test:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [main, dev]
flavor: [raw]
sdk: [dev, beta, stable]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
with:
sdk: ${{ matrix.sdk }}
flavor: ${{ matrix.flavor }}
- id: install
name: Install dependencies
- name: Install dependencies
run: dart pub get
- name: Run Chrome tests
run: dart test --platform chrome
if: always() && steps.install.outcome == 'success'

# Ensure the generation script runs.
generation:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
sdk: [main, dev]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
with:
sdk: ${{ matrix.sdk }}
- name: Install Dart dependencies
run: dart pub get
- name: Install Node dependencies
run: npm install
working-directory: tool/bindings_generator
- name: Run the generator
run: dart tool/update_bindings.dart
- name: Analyze code
run: dart analyze --fatal-infos
19 changes: 19 additions & 0 deletions .github/workflows/post_summaries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# A workflow to allow other workflow to comment on PRs.

name: Comment on the pull request

on:
# Trigger this workflow after the Health workflow completes. This workflow
# will have permissions to do things like create comments on the PR, even if
# the original workflow couldn't.
workflow_run:
workflows:
- Publish
types:
- completed

jobs:
upload:
uses: dart-lang/ecosystem/.github/workflows/post_summaries.yaml@main
permissions:
pull-requests: write
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
if: ${{ github.repository_owner == 'dart-lang' }}
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
with:
sdk: beta
write-comments: false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Dart CI](https://github.com/dart-lang/web/actions/workflows/test-package.yml/badge.svg)](https://github.com/dart-lang/web/actions/workflows/test-package.yml)
[![Dart CI](https://github.com/dart-lang/web/actions/workflows/build.yml/badge.svg)](https://github.com/dart-lang/web/actions/workflows/build.yml)
[![pub package](https://img.shields.io/pub/v/web.svg)](https://pub.dev/packages/web)
[![package publisher](https://img.shields.io/pub/publisher/web.svg)](https://pub.dev/packages/web/publisher)

Expand Down

0 comments on commit 865aeaf

Please sign in to comment.