-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added automated CI testing and autopublish on release
- Loading branch information
Sterling Long
committed
Mar 4, 2023
1 parent
9273af5
commit 2a37693
Showing
5 changed files
with
156 additions
and
0 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,25 @@ | ||
name: ci | ||
description: Executes Dart specific CI steps. | ||
inputs: | ||
type: | ||
description: The type of CI to run. | ||
required: true | ||
node-url: | ||
description: 'The endpoint of the Pact node to test with' | ||
required: false | ||
default: 'https://api.chainweb.com' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
# Setup Dependencies | ||
- uses: ./.github/actions/dependencies | ||
|
||
# Unit and Integration Tests | ||
- name: Run tests | ||
if: inputs.type == 'integration-tests' | ||
shell: bash | ||
env: | ||
NODE_URL: ${{ inputs.node-url }} | ||
run: flutter test --dart-define=RELAY_ENDPOINT=$RELAY_ENDPOINT --dart-define=PROJECT_ID=$PROJECT_ID | ||
|
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,27 @@ | ||
name: ci | ||
description: Installs dependencies | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
# General Tests | ||
- name: Install packages | ||
shell: bash | ||
run: flutter pub get | ||
|
||
# - name: Generate code | ||
# shell: bash | ||
# run: flutter pub run build_runner build --delete-conflicting-outputs | ||
|
||
- name: Install packages for example | ||
shell: bash | ||
run: cd example/dapp && flutter pub get && cd ../.. | ||
|
||
- name: Verify formatting and analyze project source | ||
shell: bash | ||
run: dart format --output=none --set-exit-if-changed . | ||
|
||
# - name: Analyze project source | ||
# shell: bash | ||
# run: flutter analyze | ||
|
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,24 @@ | ||
# Description | ||
|
||
<!-- | ||
Please include: | ||
* summary of the changes and the related issue | ||
* relevant motivation and context | ||
--> | ||
|
||
Resolves # (issue) | ||
|
||
## How Has This Been Tested? | ||
|
||
<!-- | ||
Please: | ||
* describe the tests that you ran to verify your changes. | ||
* provide instructions so we can reproduce. | ||
--> | ||
|
||
<!-- If valid for smoke test on feature add screenshots --> | ||
|
||
## Due Dilligence | ||
|
||
* [ ] Breaking change | ||
* [ ] Requires a documentation update |
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,44 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: ci | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
workflow_dispatch: | ||
|
||
|
||
concurrency: | ||
# Support push/pr as event types with different behaviors each: | ||
# 1. push: queue up builds by branch | ||
# 2. pr: only allow one run per PR | ||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }} | ||
# If there is already a workflow running for the same pull request, cancel it | ||
# For non-PR triggers queue up builds | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
test-type: [unit-tests] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install and set Flutter version | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.3.10' | ||
|
||
- uses: ./.github/actions/ci | ||
with: | ||
type: ${{ matrix.test-type }} |
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,36 @@ | ||
name: Publish to pub.dev | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+*' | ||
|
||
jobs: | ||
publish: | ||
name: Publish to pub.dev | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the repo | ||
- uses: actions/checkout@v3 | ||
|
||
# Install Flutter | ||
- name: Install and set Flutter version | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.3.10' | ||
|
||
# Setup Dart SDK | ||
- uses: dart-lang/setup-dart@v1 | ||
|
||
# Setup Dependencies | ||
- uses: ./.github/actions/dependencies | ||
|
||
# Publish | ||
- name: Check Publish Warnings | ||
shell: bash | ||
run: flutter pub publish --dry-run | ||
- name: Publish Package | ||
shell: bash | ||
run: flutter pub publish -f |