mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-01-08 19:29:32 +00:00
use reusable workflow
This commit is contained in:
parent
62c8a52e2a
commit
71eaac5237
2 changed files with 35 additions and 25 deletions
25
.github/actions/setup-env.yaml
vendored
Normal file
25
.github/actions/setup-env.yaml
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
name: 🛠️ Setup Env
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
flutter_version:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: "stable"
|
||||||
|
description: "Flutter version to use. Default is 'stable'."
|
||||||
|
jobs:
|
||||||
|
setup:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Set up Flutter
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: "${{ inputs.flutter_version }}"
|
||||||
|
flutter-version-file: pubspec.yaml
|
||||||
|
- name: Install dependencies
|
||||||
|
run: flutter pub get
|
||||||
35
.github/workflows/flutter_test.yaml
vendored
35
.github/workflows/flutter_test.yaml
vendored
|
|
@ -10,28 +10,11 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Set up Flutter
|
|
||||||
uses: subosito/flutter-action@v2
|
|
||||||
with:
|
|
||||||
channel: "stable"
|
|
||||||
flutter-version-file: pubspec.yaml
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: flutter pub get
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
needs: setup
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- uses: ./.github/actions/setup-env.yaml
|
||||||
|
|
||||||
# Debug: Echo current directory contents
|
# Debug: Echo current directory contents
|
||||||
- name: List root directory contents
|
- name: List root directory contents
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -53,12 +36,6 @@ jobs:
|
||||||
echo "\nSubmodule details:"
|
echo "\nSubmodule details:"
|
||||||
git submodule foreach 'echo $path: && pwd && ls -la'
|
git submodule foreach 'echo $path: && pwd && ls -la'
|
||||||
|
|
||||||
- name: Decode android/upload.jks
|
|
||||||
run: echo "${{ secrets.UPLOAD_KEYSTORE_JKS }}" | base64 --decode > android/upload.jks
|
|
||||||
|
|
||||||
- name: Decode android/key.properties
|
|
||||||
run: echo "${{ secrets.KEY_PROPERTIES }}" | base64 --decode > android/key.properties
|
|
||||||
|
|
||||||
- name: Run flutter tests
|
- name: Run flutter tests
|
||||||
run: flutter test
|
run: flutter test
|
||||||
|
|
||||||
|
|
@ -66,6 +43,14 @@ jobs:
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: ./.github/actions/setup-env.yaml
|
||||||
|
|
||||||
|
- name: Decode android/upload.jks
|
||||||
|
run: echo "${{ secrets.UPLOAD_KEYSTORE_JKS }}" | base64 --decode > android/upload.jks
|
||||||
|
|
||||||
|
- name: Decode android/key.properties
|
||||||
|
run: echo "${{ secrets.KEY_PROPERTIES }}" | base64 --decode > android/key.properties
|
||||||
|
|
||||||
- name: Set Up Java
|
- name: Set Up Java
|
||||||
uses: actions/setup-java@v3.12.0
|
uses: actions/setup-java@v3.12.0
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue