Skip to content

Bump shared_preferences from 2.1.2 to 2.2.0 (#1946) #742

Bump shared_preferences from 2.1.2 to 2.2.0 (#1946)

Bump shared_preferences from 2.1.2 to 2.2.0 (#1946) #742

Workflow file for this run

##############################################################################
##############################################################################
#
# NOTE!
#
# Please read the README.md file in this directory that defines what should
# be placed in this file
#
##############################################################################
##############################################################################
name: PUSH Workflow
on:
push:
# branches:
# - develop
branches-ignore:
- 'master'
tags:
- "*"
env:
CODECOV_UNIQUE_NAME: CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }}
jobs:
Flutter-Codebase-Check:
name: Checking codebase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# This is important to fetch all history for all branches and tags.
# This could be important for our documentation generation process.
# See: https://github.com/actions/checkout
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '12.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.7.3'
channel: 'stable' # or: 'beta', 'dev' or 'master'
- name: Running pub get in talawa_lint
run: cd talawa_lint && flutter pub get && cd ..
- name: Running pub get to fetch dependencies
run: flutter pub get
- name: Checking for correct formatting of code
run: dart format --set-exit-if-changed .
- name: setup python
uses: actions/setup-python@v4
- name: Check for presence of ignore directives corresponding to custom lints
run: chmod +x ./.github/workflows/check_ignore.py
- name: Run check_ignore
run: |
git branch
git checkout develop
git pull
git branch
git checkout -
pip install GitPython
python ./.github/workflows/check_ignore.py --repository ${{github.repository}} --merge_branch_name ${{github.ref_name}}
- name: Analysing codebase for default linting
run: flutter analyze --no-pub
- name: Analysing codebase for custom linting
run: flutter pub run custom_lint
# - name: Echo the GitHub environment for troubleshooting
# run: echo "$GITHUB_CONTEXT"
# - name: Echo the GitHub context for troubleshooting
# run: echo "${{ toJSON(github) }}"
Update-Documentation:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/automated-docs'
environment: TALAWA_ENVIRONMENT
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '12.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.7.3'
channel: 'stable'
- uses: dart-lang/setup-dart@v1
with:
sdk: '2.19.2'
- run: |
cd talawa_lint && flutter pub get && cd ..
flutter pub get
flutter analyze
dart analyze
flutter pub global activate dartdoc
flutter pub global run dartdoc . --output docs/talawa
- uses: actions/upload-artifact@v1
with:
name: docs
path: docs/talawa
- name: Checking doc updated
id: DocUpdated
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "updateDoc=true" >> $GITHUB_OUTPUT
echo -e "Documentation has been updated!!"
else
Green='0;32'
NoColor='\033[0m'
echo -e "${Green}No documentation updated${NoColor}"
fi
- name: Set env variables
if: steps.DocUpdated.outputs.updateDoc
run: |
echo "commit_id=$(echo $(git rev-parse HEAD))" >> $GITHUB_ENV
echo "email=$(echo $(git log --pretty=format:"%ae" $commit_id))" >> $GITHUB_ENV
- name: Handle untracked files
if: steps.DocUpdated.outputs.updateDoc
run: |
git config --global user.name "${{github.actor}}"
git config --global user.email "${{env.email}}"
git add .
- name: Update Doc
if: steps.DocUpdated.outputs.updateDoc
run: |
Green='0;32'
NoColor='\033[0m'
git config --global user.name "${{github.actor}}"
git config --global user.email "${{env.email}}"
git commit -a -m "Updated docs"
git push
echo -e "🚀${Green} Hurrah! doc updated${NoColor}"
Documentation-to-talawa-docs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/automated-docs'
needs: Update-Documentation
steps:
- uses: actions/checkout@v3
- uses: dmnemec/copy_file_to_another_repo_action@v1.1.1
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB_NEW }}
with:
source_file: 'docs/talawa/'
destination_repo: 'PalisadoesFoundation/talawa-docs'
destination_branch: 'develop'
destination_folder: 'static'
user_email: '${{env.email}}'
user_name: '${{github.actor}}'
commit_message: 'Overwriting static/talawa from talawa-repo'
Flutter-Testing:
name: Testing codebase
runs-on: ubuntu-latest
needs: Flutter-Codebase-Check
# needs: Update-Documentation
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '12.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.7.3'
channel: 'stable' # or: 'beta', 'dev' or 'master'
- name: Running pub get in talawa_lint
run: cd talawa_lint && flutter pub get && cd ..
- name: Running pub get to fetch dependencies
run: flutter pub get
- name: Codebase testing
run: flutter test --coverage
- name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
uses: codecov/codecov-action@v3
with:
verbose: true
fail_ci_if_error: false
name: '${{env.CODECOV_UNIQUE_NAME}}'
Android-Build-and-Release:
name: Testing build for android
permissions:
contents: write
environment: TALAWA_ENVIRONMENT
runs-on: ubuntu-latest
needs: Flutter-Testing
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '12.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.7.3'
channel: 'stable' # or: 'beta', 'dev' or 'master'
- name: Running pub get in talawa_lint
run: cd talawa_lint && flutter pub get && cd ..
- name: Running pub get to fetch dependencies
run: flutter pub get
- name: Building for android
run: flutter build apk
###################################################
## Release the built apk as an automated release ##
###################################################
- uses: ncipollo/release-action@v1
with:
name: "Automated Android Release"
artifacts: "./build/app/outputs/flutter-apk/app-release.apk"
allowUpdates: "true"
generateReleaseNotes: false
tag: "automated"
body: |
This is an automated release, triggered by a recent push.
This may or may not be stable, so please have a look at the stable release(s).
iOS-Build:
name: Testing build for iOS
runs-on: macos-latest
needs: Flutter-Testing
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.7.3'
channel: 'stable' # or: 'beta', 'dev' or 'master'
architecture: x64
- name: Building for ios
run: flutter build ios --release --no-codesign