Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(SNP-903): Add CI, add new templates, update FVM #99

Merged
merged 26 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
62c921e
chore(SNP-903): FVM update
martynov-alex Feb 28, 2024
90272ee
chore(SNP-903): add new PR and issues templates
martynov-alex Feb 28, 2024
45caaed
chore(SNP-903): add GitHub Action workflows
martynov-alex Feb 28, 2024
6df405b
doc: change Overview to Description because of CI
martynov-alex Feb 28, 2024
ea7f92c
chore: Fix dependency validator CI step
martynov-alex Feb 28, 2024
2ea5ced
chore: Update dart_dependency_validator.yaml
martynov-alex Feb 28, 2024
99ed101
chore: add special analysis workflow
martynov-alex Mar 4, 2024
294f0a9
chore: delete dart_dependency_validator.yaml
martynov-alex Mar 4, 2024
3baa68f
doc: update readme
martynov-alex Mar 4, 2024
7205c44
chore: update goldens
martynov-alex Mar 4, 2024
dda1c80
chore: add a file generation step
martynov-alex Mar 4, 2024
2be8f05
chore: update a file generation step
martynov-alex Mar 4, 2024
164dd65
Merge branch 'main' of github.com:surfstudio/surf-flutter-app-templat…
martynov-alex Mar 4, 2024
5ea99fd
chore: update a file generation step
martynov-alex Mar 4, 2024
459aaa8
chore: formatter
martynov-alex Mar 4, 2024
9fecdda
chore: formatter
martynov-alex Mar 4, 2024
0a2c348
chore: add special testing workflow
martynov-alex Mar 4, 2024
84fd0d7
chore: update test
martynov-alex Mar 4, 2024
ab1b57d
chore: update goldens
martynov-alex Mar 4, 2024
0b3538c
Merge branch 'main' of github.com:surfstudio/surf-flutter-app-templat…
martynov-alex Mar 18, 2024
eebb910
chore: add generate: true
martynov-alex Mar 18, 2024
4fd3a9c
chore: add generate: true
martynov-alex Mar 18, 2024
1b353b1
chore: format to 120
martynov-alex Mar 18, 2024
84f3e55
chore: delete generate: true
martynov-alex Mar 18, 2024
f943c25
chore: update ci
martynov-alex Mar 18, 2024
3c3e025
chore: update ci
martynov-alex Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .fvm/fvm_config.json

This file was deleted.

3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.19.0"
}
9 changes: 6 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
name: Bug report
about: Something is wrong with project.
about: Something is wrong.
title: "[BUG] "
labels: bug
---

<!--
Thank you for contributing to our project!
This template is only for bugfix reports, otherwise please use another template.
-->
## Expected behavior
<!--Tell us what should happen-->

Expand Down Expand Up @@ -52,4 +55,4 @@ What did you try to solve the problem?
- [ ] Added isolated way to reproduce the bug.
- [ ] Specified Flutter, Dart version and platforms.
- [ ] Attached error code and logs.
- [ ] All unspecified fields in the Issue description deleted.
- [ ] All unspecified fields in the Issue description are deleted.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: SurfGear telegram chat
url: https://t.me/SurfGear
about: Please ask and answer questions here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Documentation update
about: Fixing a problem or improve in an existing docs page.
labels: documentation
---
<!--
Thank you for contributing to our project!
This template is only for documentation update reports, otherwise please use another template.
-->
## Specify package name
<!--Write the name of the package where you have problems-->

## Describe what scenario you think is uncovered by the existing examples / articles
<!--A clear and concise description of the problem that you want explained.-->

## Describe why existing examples / articles do not cover this case
<!--Explain which examples / articles you have seen before making this request, and why they did not help you with your problem.-->

## Additional context
<!--Add any other context or screenshots about the documentation request here.-->
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature request
about: I'd like SurfGear team to do something new.
labels: enhancement
---
<!--
Thank you for contributing to our project!
This template is only for feature requests, otherwise please use another template.

Provide thoughtful commentary *and code samples* on what this feature means for your product. What will it allow you to do that you can't do today? How will it make current workarounds straightforward? What potential bugs and edge cases does it help to avoid? etc. Please keep it product-centric.
-->
## Specify package name
<!--Write the name of the package where you have problems-->

## What is the new or updated feature that you are suggesting?
<!--A clear and concise description of what you want to happen.-->

## Why should this feature be included?
<!--Is your feature request related to a problem? Please describe a clear and concise description of what the problem is. If you investigate any alternative solutions, please describe.-->

## Additional context
<!--Please provide any other context or screenshots about the feature request here.-->
74 changes: 5 additions & 69 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,6 @@
## Related tasks
<!--
For more info https://github.com/surfstudio/flutter-roadmap/blob/main/docs/PULL_REQUEST_TEMPLATE_README.md#related-tasks
-->
Tap on "Preview" ⤴


## Dependence on other Pull Requests (optional)
<!--
For more info https://github.com/surfstudio/flutter-roadmap/blob/main/docs/PULL_REQUEST_TEMPLATE_README.md#dependence-on-other-pull-requests-optional
-->

## Background (optional)
<!--
For more info https://github.com/surfstudio/flutter-roadmap/blob/main/docs/PULL_REQUEST_TEMPLATE_README.md#background-optional
-->

## Changes
<!--
For more info https://github.com/surfstudio/flutter-roadmap/blob/main/docs/PULL_REQUEST_TEMPLATE_README.md#changes
-->

## Troubles (optional)
<!--
For more info https://github.com/surfstudio/flutter-roadmap/blob/main/docs/PULL_REQUEST_TEMPLATE_README.md#troubles-optional
-->

## Note (optional)
<!--
For more info https://github.com/surfstudio/flutter-roadmap/blob/main/docs/PULL_REQUEST_TEMPLATE_README.md#note-optional
-->

## Checklist for self-check
- [ ] Commits and PRs have been filed according to [the rules on the project](https://github.com/surfstudio/surf-flutter-app-template#workflow-in-a-repository).
- [ ] The author is marked as an assigne and assigned mandatory reviewers.
- [ ] Required labels marked
- [ ] Specified related tasks and/or related PRs.
- [ ] Specified Changes.
- [ ] Attached videos/screenshots demonstrating the fix/feature.
- [ ] All unspecified fields in the PR description deleted.
- [ ] New code covered by tests.

## Checklist for reviewers
- [ ] CI passed successfully _(with a green check mark)_.
- [ ] PR is atomic, by volume no more than 400 (+-) corrected lines (not including codogen).

Design:
- [ ] System design corresponds to the agreements on structure and architecture on the project.
- [ ] The code is decomposed into necessary and sufficient components.

Functionality:
- [ ] The code solves the problem.
- [ ] Any changes to the user interface are reasonable and look good.

Complexity:
- [ ] The code is clear, easy to read, functions are small, no more than 50 lines.
- [ ] The logic is not overcomplicated, there is no overengineering (no code sections that may be needed in the future, but no one knows about it).

Tests:
- [ ] Updated or added tests for mandatory components.
- [ ] The tests are correct, helpful, and well designed/developed.

Naming:
- [ ] The naming of variables, methods, classes and other components is understandable.

Comments:
- [ ] The comments are understandable and helpful.

Documentation:
- [ ] All labels are correct
- [ ] Technical documentation updated (after approval, updates last reviewer).
And choose one of the templates:
* [Bugfix PR](?expand=1&template=bug_fix.md)
* [New feature PR](?expand=1&template=new_feature.md)
* [Documentation update PR](?expand=1&template=documentation_update.md)
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/bug_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
Thank you for contributing to our project!
Provide a description of your changes below and a general summary in the title.
Please look at the following checklist to ensure that your PR can be accepted quickly:
-->
## Checklist

- [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
- [ ] Is there an existing issue for this PR?
- _link issue here_ (use keywords like `fix`, `close`, `resolve` etc. if necessary)
- [ ] Have the files been linted and formatted?
- [ ] Have the docs been updated to match the changes in the PR?
- [ ] Have the tests been updated to match the changes in the PR?
- [ ] Attached videos/screenshots demonstrating the fix/feature.
- [ ] Have you run the tests locally to confirm they pass?

## Changes

### What is the current behavior, and the steps to reproduce the issue?

### What is the expected behavior?

### How does this PR fix the problem?
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/documentation_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
Thank you for contributing to our project!
Provide a description of your changes below and a general summary in the title.
Please look at the following checklist to ensure that your PR can be accepted quickly:
-->
## Checklist

- [ ] Is there an existing issue for this PR?
- _link issue here_ (use keywords like `fix`, `close`, `resolve` etc. if necessary)
- [ ] Have the files been linted and formatted?

## Changes

### What docs page needs to be fixed?

- **Section**:
- **Page**:

## What is the problem?

## What changes does this PR make to fix the problem?
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/new_feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
Thank you for contributing to our project!
Provide a description of your changes below and a general summary in the title.
Please look at the following checklist to ensure that your PR can be accepted quickly:
-->
## Checklist

- [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
- [ ] Is there an existing issue for this PR?
- _link issue here_ (use keywords like `fix`, `close`, `resolve` etc. if necessary)
- [ ] Have the files been linted and formatted?
- [ ] Have the docs been updated to match the changes in the PR?
- [ ] Have the tests been updated to match the changes in the PR?
- [ ] Attached videos/screenshots demonstrating the fix/feature.
- [ ] Have you run the tests locally to confirm they pass?

## New Features

### What new capabilities does this PR add?

### What docs changes are needed to explain this?
62 changes: 62 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: "Analysis"

on:
workflow_call:
inputs:
flutter-version:
required: false
type: string

jobs:
check_branch_content:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Content
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "LICENSE, README.md, CHANGELOG.md, CONTRIBUTING.md"

- name: File exists
if: steps.check_files.outputs.files_exists == 'true'
run: echo Content is ok!

analysis:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Flutter with exact version
if: ${{ inputs.flutter-version != ''}}
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ inputs.flutter-version }}

- name: Install Flutter from Stable branch
if: ${{ inputs.flutter-version == ''}}
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Install dependencies
run: flutter pub get

- name: Run formatter
run: dart format -l 120 --set-exit-if-changed lib test

- name: Generate files
run: dart run build_runner build --delete-conflicting-outputs

- name: Run analyzer
run: flutter analyze --fatal-warnings --fatal-infos .

- name: Run package analyzer
uses: axel-op/dart-package-analyzer@v3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/check_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Checking issue for correctness of described"

on:
issues:
types:
- reopened
- opened

jobs:
check-issue:
if: github.repository == 'surfstudio/surf-flutter-app-template'
uses: surfstudio/flutter-ci-workflows/.github/workflows/check_issues.yaml@main
with:
REPO_PATH: 'https://github.com/surfstudio/surf-flutter-app-template/issues/new/choose'
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_BODY: ${{ github.event.issue.body }}
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Main"

on:
pull_request:

jobs:
get_fvm_version:
if: github.repository == 'surfstudio/surf-flutter-app-template'
outputs:
flutter_version: ${{ steps.fvm_version.outputs.flutter }}
name: "Get Flutter version from FVM"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- id: fvm_version
uses: zoexx/github-action-json-file-properties@release
with:
file_path: ".fvmrc"

analysis:
needs: get_fvm_version
uses: ./.github/workflows/analysis.yml
with:
flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }}

testing:
needs: [analysis, get_fvm_version]
uses: ./.github/workflows/testing.yml
with:
flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/new_issue_to_pyrus_task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Create Pyrus task from issue"

on:
issues:
types:
- reopened
- opened

jobs:
get_package_name:
if: github.repository == 'surfstudio/surf-flutter-app-template'
name: Get package name
runs-on: ubuntu-latest
outputs:
package_name: ${{ steps.parse_pubspec.outputs.name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Parsing pubspec.yaml
id: parse_pubspec
uses: actions-tools/yaml-outputs@v2
with:
file-path: 'pubspec.yaml'

call_create_pyrus_task_from_issue:
name: Create Pyrus task from issue
needs: get_package_name
uses: surfstudio/flutter-ci-workflows/.github/workflows/new_issue_to_pyrus_task.yml@main
with:
PACKAGE_NAME: ${{ needs.get_package_name.outputs.package_name }}
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_BODY: ${{ github.event.issue.body }}
ISSUE_LINK: ${{ github.event.issue.html_url }}
secrets:
LOGIN: ${{ secrets.PYRUS_BOT_LOGIN }}
SECURITY_KEY: ${{ secrets.PYRUS_BOT_SECRET_KEY }}
Loading
Loading