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

[#255] Generate sample project as a part of test workflow #259

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 0 additions & 57 deletions .github/workflows/generate_sample.yml

This file was deleted.

56 changes: 51 additions & 5 deletions .github/workflows/test.yml
luongvo marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ on:
# but push action is only for the feature branch
pull_request:
types: [ opened, synchronize, reopened ]
push:
branches-ignore:
- develop
- 'release/**'
- main

jobs:
test:
Expand Down Expand Up @@ -88,3 +83,54 @@ jobs:
git add bricks
git commit -m "[Chore] Generate Mason bundle"
git push

generate_sample_project:
# The job generate_sample_project identify that the job generate_mason_bundle must complete successfully
# before this generate_sample_project job will run
needs: generate_mason_bundle
luongvo marked this conversation as resolved.
Show resolved Hide resolved
name: Generate the sample project
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Set up Flutter environment
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.10.5'

- name: Remove the old sample project
run: |
rm -rf sample

- name: Set the project name "sample"
uses: jossef/[email protected]
with:
file: mason-config.json
field: project_name
value: sample

- name: Generate the new sample project
run: |
dart pub global activate mason_cli
mason get
mason make template -c mason-config.json

- id: changes
name: Check for changes in the sample project
run: |
count=$(git status sample --porcelain | wc -l)
echo "count=$count" >> $GITHUB_OUTPUT

- name: Commit & push the sample project changes
if: steps.changes.outputs.count > 0
run: |
git config user.name team-nimblehq
git config user.email [email protected]
git add sample
git commit -m "[Chore] Generate & update sample project"
git push