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: test common workflow #955

Closed
wants to merge 1 commit into from
Closed
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
21 changes: 21 additions & 0 deletions .github/workflows/common/common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Common Workflow

on:
workflow_call:

jobs:
common:
steps:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true

- name: Fetch Flutter Dependencies
run: flutter pub get

- name: Validate Code Format
run: dart format --output=none --set-exit-if-changed .

- name: Analyze Code
run: flutter analyze
14 changes: 1 addition & 13 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true

- name: Fetch Flutter Dependencies
run: flutter pub get

- name: Validate Code Format
run: dart format --output=none --set-exit-if-changed .

- name: Analyze Code
run: flutter analyze
- uses: ./.github/workflows/common/common.yml

android:
name: Android Flutter Build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
- name: Hydrate and Update Version
id: flutter-version
run: |
git config --global user.name "${{ github.workflow }}"
git config --global user.email "gh-actions@${{ github.repository_owner }}"
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

git clone --branch=version https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} version
cd version
Expand Down Expand Up @@ -136,8 +136,8 @@ jobs:
- name: Upload APK/AAB to apk branch
if: ${{ github.repository == 'fossasia/badgemagic-android' }}
run: |
git config --global user.name "${{ github.workflow }}"
git config --global user.email "gh-actions@${{ github.repository_owner }}"
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk
cd apk
Expand Down
Loading