From 88884017b2665ca525d03b882f01f73bc5305037 Mon Sep 17 00:00:00 2001 From: dreautall <109872040+dreautall@users.noreply.github.com> Date: Sat, 24 Feb 2024 07:07:14 +0000 Subject: [PATCH] [gh] restructure wf files --- .github/workflows/commit.yml | 48 ++++----------------------------- .github/workflows/release.yml | 4 +-- .github/workflows/setup_env.yml | 33 +++++++++++++++++++++++ 3 files changed, 40 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/setup_env.yml diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index f6370d60..c7bf9be4 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -2,58 +2,20 @@ name: Check on: push: - workflow_call: - inputs: - external_call: - description: 'To distinguish workflow_call from regular push' - type: boolean - required: false - default: true jobs: - setup_env: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - # Setup the Java environment. - - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: ${{vars.JAVA_VERSION}} - cache: 'gradle' - - # Setup the Flutter environment. - - uses: subosito/flutter-action@v2 - with: - channel: ${{vars.FLUTTER_CHANNEL}} - cache: true - - # No dart analytics. - - run: dart --disable-analytics - - # No flutter analytics. - - run: flutter config --disable-analytics - - # Get flutter dependencies. - - run: flutter pub get - analyze: runs-on: ubuntu-latest - needs: [setup_env] steps: + # Call setup_env workflow to setup workspace + - uses: ./.github/workflows/setup_env.yml + # Check for any formatting issues in the code. - run: dart format --set-exit-if-changed . # Statically analyze the Dart code for any errors. - run: dart analyze . -# test: -# runs-on: ubuntu-latest -# needs: [analyze] -# -# steps: -# # Run widget tests for our flutter project. -# - run: flutter test \ No newline at end of file + # Run widget tests for our flutter project. + # - run: flutter test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef976568..91d78885 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,8 +16,8 @@ jobs: runs-on: ubuntu-latest steps: - # Call Commit workflow to setup workspace - - uses: ./.github/workflows/commit.yml + # Call setup_env workflow to setup workspace + - uses: ./.github/workflows/setup_env.yml # Generate keystore - uses: timheuer/base64-to-file@v1.2 diff --git a/.github/workflows/setup_env.yml b/.github/workflows/setup_env.yml new file mode 100644 index 00000000..a0b6a068 --- /dev/null +++ b/.github/workflows/setup_env.yml @@ -0,0 +1,33 @@ +name: Setup ENV + +on: + workflow_call: + +jobs: + setup_env: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + # Setup the Java environment. + - uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: ${{vars.JAVA_VERSION}} + cache: 'gradle' + + # Setup the Flutter environment. + - uses: subosito/flutter-action@v2 + with: + channel: ${{vars.FLUTTER_CHANNEL}} + cache: true + + # No dart analytics. + - run: dart --disable-analytics + + # No flutter analytics. + - run: flutter config --disable-analytics + + # Get flutter dependencies. + - run: flutter pub get \ No newline at end of file