Skip to content

Commit

Permalink
[#225] Generate sample project as a part of test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nmint8m committed Aug 1, 2023
1 parent 6ce179b commit 235412d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 57 deletions.
57 changes: 0 additions & 57 deletions .github/workflows/generate_sample.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,55 @@ 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
name: Generate the sample project
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out
uses: actions/checkout@v3
with:
token: ${{ secrets.WIKI_ACTION_TOKEN }}
ref: ${{ github.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

0 comments on commit 235412d

Please sign in to comment.