-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Simple Dart Project with GitHub Actions CI. (#1)
- Loading branch information
Showing
9 changed files
with
196 additions
and
23 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,135 @@ | ||
name: Relic CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
|
||
env: | ||
PUB_CACHE_PATH: ~/.pub-cache | ||
|
||
jobs: | ||
dart_format: | ||
name: Verify Dart Formatting | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
dart_sdk: ['3.3.0'] | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Setup Dart | ||
uses: dart-lang/[email protected] | ||
with: | ||
sdk: ${{ matrix.dart_sdk }} | ||
- name: Cache Dart dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.PUB_CACHE_PATH }} | ||
key: ${{ runner.os }}-pub-cache-${{ matrix.dart_sdk }} | ||
restore-keys: | | ||
${{ runner.os }}-pub-cache- | ||
- name: Verify formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
|
||
dart_analyze: | ||
name: Run Dart Analysis | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
dart_sdk: ['3.3.0', 'stable'] | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Setup Dart | ||
uses: dart-lang/[email protected] | ||
with: | ||
sdk: ${{ matrix.dart_sdk }} | ||
- name: Cache Dart dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.PUB_CACHE_PATH }} | ||
key: ${{ runner.os }}-pub-cache-${{ matrix.dart_sdk }} | ||
restore-keys: | | ||
${{ runner.os }}-pub-cache- | ||
- name: Install dependencies | ||
run: dart pub upgrade | ||
- name: Analyze | ||
run: dart analyze | ||
|
||
dart_analyze_downgrade: | ||
name: Run Dart Analysis Downgrade | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Setup Dart | ||
uses: dart-lang/[email protected] | ||
with: | ||
sdk: '3.3.0' | ||
- name: Cache Dart dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.PUB_CACHE_PATH }} | ||
key: ${{ runner.os }}-pub-cache-downgrade | ||
restore-keys: | | ||
${{ runner.os }}-pub-cache- | ||
- name: Install dependencies (Downgrade) | ||
run: dart pub downgrade | ||
- name: Analyze | ||
run: dart analyze | ||
|
||
dart_analyze_latest_downgrade: | ||
name: Run Dart Analysis Latest (stable) Downgrade | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Setup Dart | ||
uses: dart-lang/[email protected] | ||
with: | ||
sdk: 'stable' | ||
- name: Cache Dart dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.PUB_CACHE_PATH }} | ||
key: ${{ runner.os }}-pub-cache-downgrade | ||
restore-keys: | | ||
${{ runner.os }}-pub-cache- | ||
- name: Install dependencies (Downgrade) | ||
run: dart pub downgrade | ||
- name: Analyze | ||
run: dart analyze | ||
|
||
unit_tests: | ||
name: Run Unit Tests | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
dart_sdk: ['3.3.0'] | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Setup Dart | ||
uses: dart-lang/[email protected] | ||
with: | ||
sdk: ${{ matrix.dart_sdk }} | ||
- name: Cache Dart dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.PUB_CACHE_PATH }} | ||
key: ${{ runner.os }}-pub-cache-${{ matrix.dart_sdk }} | ||
restore-keys: | | ||
${{ runner.os }}-pub-cache- | ||
- name: Install dependencies | ||
run: dart pub upgrade | ||
- name: Run tests | ||
run: dart test |
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 |
---|---|---|
@@ -1,27 +1,15 @@ | ||
# See https://www.dartlang.org/guides/libraries/private-files | ||
|
||
# Files and directories created by pub | ||
# Dart tool and build artifacts | ||
.dart_tool/ | ||
.packages | ||
.pub/ | ||
build/ | ||
# If you're building an application, you may want to check-in your pubspec.lock | ||
pubspec.lock | ||
|
||
# Directory created by dartdoc | ||
# If you don't generate documentation locally you can remove this line. | ||
doc/api/ | ||
|
||
# dotenv environment variables file | ||
.env* | ||
# macOS system files | ||
.DS_Store | ||
|
||
# Avoid committing generated Javascript files: | ||
*.dart.js | ||
*.info.json # Produced by the --dump-info flag. | ||
*.js # When generated by dart2js. Don't specify *.js if your | ||
# project includes source files written in JavaScript. | ||
*.js_ | ||
*.js.deps | ||
*.js.map | ||
# IDE and editor configurations | ||
.atom/ | ||
.idea/ | ||
.vscode/ | ||
.vscode-test/ | ||
|
||
.flutter-plugins | ||
.flutter-plugins-dependencies |
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,3 @@ | ||
## 0.1.0 | ||
|
||
- Initial version. |
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# relic | ||
Strictly typed HTTP server with incredible performance. | ||
# Relic | ||
|
||
Relic is a basic HTTP server based on Shelf. Unlike Shelf, Relic is strictly typed, and it has some other performance improvements. This release is still experimental. | ||
|
||
Relic is primarily created for [Serverpod](https://serverpod.dev). |
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 @@ | ||
include: package:lints/recommended.yaml |
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,8 @@ | ||
/// Support for doing something awesome. | ||
/// | ||
/// More dartdocs go here. | ||
library; | ||
|
||
export 'src/relic_base.dart'; | ||
|
||
// TODO: Export any libraries intended for clients of this package. |
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,4 @@ | ||
/// Checks if you are awesome. Spoiler: you are. | ||
class Awesome { | ||
bool get isAwesome => true; | ||
} |
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,15 @@ | ||
name: relic | ||
description: A lightweight web server inspired by Shelf. | ||
version: 0.2.0 | ||
repository: https://github.com/serverpod/relic | ||
|
||
environment: | ||
sdk: '>=3.3.0 <4.0.0' | ||
|
||
dependencies: | ||
|
||
dev_dependencies: | ||
dart_flutter_team_lints: ^3.0.0 | ||
http: '>=1.0.0 <2.0.0' | ||
test: ^1.24.2 | ||
test_descriptor: ^2.0.1 |
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,16 @@ | ||
import 'package:relic/relic.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
group('A group of tests', () { | ||
final awesome = Awesome(); | ||
|
||
setUp(() { | ||
// Additional setup goes here. | ||
}); | ||
|
||
test('First Test', () { | ||
expect(awesome.isAwesome, isTrue); | ||
}); | ||
}); | ||
} |