Skip to content

Commit

Permalink
- Add PR CI GitHub Actions
Browse files Browse the repository at this point in the history
- Add Makefile
- Add Dart 3 support
- Bump HTTP dependency to v1.1
  • Loading branch information
nwithan8 committed Dec 22, 2023
1 parent d5917c5 commit 0ddee4b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/tests_on_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run unit tests on PR

on:
pull_request: ~
workflow_dispatch: ~

jobs:

# Run unit tests
tests:
name: 'Run unit tests'
runs-on: ubuntu-latest
steps:
# Checkout repository
- uses: actions/checkout@v3

# Setup Dart SDK
- uses: dart-lang/setup-dart@main

# Set temporary version number
- name: Set temporary version number
uses: jacobtomlinson/[email protected]
with:
find: "VERSIONADDEDBYGITHUB"
replace: "1.0.0"
regex: false

# Minimal package setup
- name: Install dependencies
run: dart pub get
working-directory: ${{ inputs.working-directory }}

# Run unit tests
- name: Run unit tests
run: make unit_tests
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## help - Display help about make targets for this Makefile
help:
@cat Makefile | grep '^## ' --color=never | cut -c4- | sed -e "`printf 's/ - /\t- /;'`" | column -s "`printf '\t'`" -t

## unit_tests - Run unit tests
unit_tests:
dart test test/tests.dart
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ version: VERSIONADDEDBYGITHUB
repository: https://github.com/nwithan8/dartvcr

environment:
sdk: '>=2.18.2 <3.0.0'
sdk: '>=2.18.2'

dependencies:
http: ^0.13.0
http: ^1.1.0
http_parser: ^4.0.0
json_annotation: ^4.7.0
meta: ^1.3.0
Expand All @@ -19,7 +19,7 @@ dev_dependencies:
collection: ^1.15.0
dependency_validator:
json_serializable: ^6.0.0
lints: ^2.0.0
lints: ^3.0.0
mockito: ^5.0.0
pub_semver:
test: ^1.16.0
Expand Down

0 comments on commit 0ddee4b

Please sign in to comment.