Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 7203e37

Browse files
authored
Migrate to GitHub Actions (#304)
1 parent 576e31e commit 7203e37

File tree

3 files changed

+83
-26
lines changed

3 files changed

+83
-26
lines changed

.github/workflows/test-package.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Dart CI
2+
3+
on:
4+
# Run on PRs and pushes to the default branch.
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
schedule:
10+
- cron: "0 0 * * 0"
11+
12+
env:
13+
PUB_ENVIRONMENT: bot.github
14+
15+
jobs:
16+
# Check code formatting and static analysis on a single OS (linux)
17+
# against Dart dev and 2.7.0.
18+
analyze:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
sdk: [dev]
24+
version: [latest]
25+
include:
26+
- sdk: stable
27+
version: 2.7.0
28+
steps:
29+
- uses: actions/checkout@v2
30+
- uses: cedx/setup-dart@v2 # TODO(dart-lang/setup-dart#3): use the official setup-dart action
31+
with:
32+
release-channel: ${{ matrix.sdk }}
33+
version: ${{ matrix.version }}
34+
- id: install
35+
name: Install dependencies
36+
run: pub get
37+
- name: Check formatting
38+
run: dartfmt --dry-run --set-exit-if-changed .
39+
if: always() && steps.install.outcome == 'success'
40+
- name: Analyze code
41+
run: dartanalyzer --fatal-infos --fatal-warnings .
42+
if: always() && steps.install.outcome == 'success'
43+
44+
# Run tests on a matrix consisting of two dimensions:
45+
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
46+
# 2. release channel: dev, 2.7.0
47+
test:
48+
needs: analyze
49+
runs-on: ${{ matrix.os }}
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
# Add macos-latest and/or windows-latest if relevant for this package.
54+
os: [ubuntu-latest]
55+
sdk: [dev]
56+
version: [latest]
57+
include:
58+
- os: ubuntu-latest
59+
sdk: stable
60+
version: 2.7.0
61+
steps:
62+
- uses: actions/checkout@v2
63+
- uses: cedx/setup-dart@v2 # TODO(dart-lang/setup-dart#3): use the official setup-dart action
64+
with:
65+
release-channel: ${{ matrix.sdk }}
66+
version: ${{ matrix.version }}
67+
- id: install
68+
name: Install dependencies
69+
run: pub get
70+
- name: Run VM tests
71+
run: pub run test --platform vm
72+
if: always() && steps.install.outcome == 'success'

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[![Pub package](https://img.shields.io/pub/v/code_builder.svg)](https://pub.dev/packages/code_builder)
2-
[![Build status](https://travis-ci.org/dart-lang/code_builder.svg)](https://travis-ci.org/dart-lang/code_builder)
2+
[![Build Status](https://github.com/dart-lang/code_builder/workflows/Dart%20CI/badge.svg?branch=master)](https://github.com/dart-lang/code_builder/actions?query=workflow%3A%22Dart+CI%22+branch%3Amaster)
33
[![Gitter chat](https://badges.gitter.im/dart-lang/build.svg)](https://gitter.im/dart-lang/build)
44

55
A fluent, builder-based library for generating valid Dart code.
@@ -29,15 +29,16 @@ void main() {
2929
```
3030

3131
Outputs:
32+
3233
```dart
3334
class Animal extends Organism {
3435
void eat() => print('Yum!');
3536
}
3637
```
3738

38-
Have a complicated set of dependencies for your generated code?
39-
`code_builder` supports automatic scoping of your ASTs to automatically
40-
use prefixes to avoid symbol conflicts:
39+
Have a complicated set of dependencies for your generated code? `code_builder`
40+
supports automatic scoping of your ASTs to automatically use prefixes to avoid
41+
symbol conflicts:
4142

4243
```dart
4344
import 'package:code_builder/code_builder.dart';
@@ -60,6 +61,7 @@ void main() {
6061
```
6162

6263
Outputs:
64+
6365
```dart
6466
import 'package:a/a.dart' as _i1;
6567
import 'package:b/b.dart' as _i2;
@@ -70,8 +72,8 @@ _i2.Other doOther() {}
7072

7173
## Contributing
7274

73-
* Read and help us document common patterns over [at the wiki][wiki].
74-
* Is there a *bug* in the code? [File an issue][issue].
75+
- Read and help us document common patterns over [at the wiki][wiki].
76+
- Is there a _bug_ in the code? [File an issue][issue].
7577

7678
If a feature is missing (the Dart language is always evolving) or you'd like an
7779
easier or better way to do something, consider [opening a pull request][pull].
@@ -91,9 +93,9 @@ will be on a best-effort basis.
9193
9294
### Updating generated (`.g.dart`) files
9395
94-
> **NOTE**: There is currently a limitation in `build_runner` that requires
95-
> a workaround for developing this package. We expect this to be unnecessary
96-
> in the future.
96+
> **NOTE**: There is currently a limitation in `build_runner` that requires a
97+
> workaround for developing this package. We expect this to be unnecessary in
98+
> the future.
9799
98100
Use [`build_runner`][build_runner]:
99101

0 commit comments

Comments
 (0)