Skip to content

Commit

Permalink
add an initial CI
Browse files Browse the repository at this point in the history
  • Loading branch information
devoncarew committed Jan 23, 2024
1 parent 3b0fc60 commit e003f63
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/google_generative_ai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:google_generative_ai"
about: "Create a bug or file a feature request against package:google_generative_ai."
labels: "package:google_generative_ai"
---
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Dependabot configuration file; see
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates

version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
7 changes: 7 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Configuration for .github/workflows/pull_request_label.yml.

'type-infra':
- '.github/**'

'package:google_generative_ai':
- 'pkgs/google_generative_ai/**'
46 changes: 46 additions & 0 deletions .github/workflows/google_generative_ai.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: package:google_generative_ai

permissions: read-all

on:
pull_request:
branches: [ main ]
paths:
- '.github/workflows/google_generative_ai.yml'
- 'pkgs/google_generative_ai/**'
push:
branches: [ main ]
paths:
- '.github/workflows/google_generative_ai.yml'
- 'pkgs/google_generative_ai/**'
schedule:
- cron: '0 0 * * 0' # weekly

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: pkgs/google_generative_ai
strategy:
fail-fast: false
matrix:
sdk: ['3.0', stable, dev]
include:
- sdk: stable
run-tests: true
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
with:
sdk: ${{ matrix.sdk }}

- run: dart pub get

- run: dart analyze --fatal-infos

- run: dart format --output=none --set-exit-if-changed .
if: ${{matrix.run-tests}}

- run: dart test
if: ${{matrix.run-tests}}
43 changes: 43 additions & 0 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: samples

permissions: read-all

on:
pull_request:
branches: [ main ]
paths:
- '.github/workflows/samples.yml'
- 'samples/**'
push:
branches: [ main ]
paths:
- '.github/workflows/samples.yml'
- 'samples/**'
schedule:
- cron: '0 0 * * 0' # weekly

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: samples
strategy:
fail-fast: false
matrix:
sdk: [stable, dev]
include:
- sdk: stable
check-formatting: true
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
with:
sdk: ${{ matrix.sdk }}

- run: dart pub get

- run: dart analyze --fatal-infos

- run: dart format --output=none --set-exit-if-changed .
if: ${{matrix.check-formatting}}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ dependencies:

TODO: Update documentation and add link.

## Packages

| Package | Description | Version |
| --- | --- | --- |
| [google_generative_ai](pkgs/google_generative_ai/) | The Google Generative AI SDK for Dart - allows access to state-of-the-art LLMs. | |

## Contributing

See [Contributing](docs/CONTRIBUTING.md) for more information on contributing to
Expand Down
5 changes: 5 additions & 0 deletions pkgs/google_generative_ai/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
name: google_generative_ai
description: >-
The Google Generative AI SDK for Dart - allows access to state-of-the-art
LLMs.
repository: https://github.com/google/generative-ai-dart/tree/main/pkgs/google_generative_ai

publish_to: none

environment:
Expand Down

0 comments on commit e003f63

Please sign in to comment.