From 4cbccf971c843ab301cc9a2d52d1c3e2b7582196 Mon Sep 17 00:00:00 2001 From: dreautall <109872040+dreautall@users.noreply.github.com> Date: Sat, 24 Feb 2024 07:29:57 +0000 Subject: [PATCH] [gh] refactor --- .github/actions/setup_env/action.yml | 26 +++++++++++++++++++++++ .github/workflows/commit.yml | 6 +++--- .github/workflows/release.yml | 4 ++-- .github/workflows/setup_env.yml | 31 ---------------------------- 4 files changed, 31 insertions(+), 36 deletions(-) create mode 100644 .github/actions/setup_env/action.yml delete mode 100644 .github/workflows/setup_env.yml diff --git a/.github/actions/setup_env/action.yml b/.github/actions/setup_env/action.yml new file mode 100644 index 00000000..da98aab7 --- /dev/null +++ b/.github/actions/setup_env/action.yml @@ -0,0 +1,26 @@ +name: Setup Flutter environment +description: Setup Flutter environment +runs: + using: "composite" + steps: + # 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 diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 7d4a12d1..50c653a6 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -10,8 +10,8 @@ jobs: steps: - uses: actions/checkout@v4 - # Call setup_env workflow to setup workspace - - uses: ./.github/workflows/setup_env.yml + # Call setup_env action to setup workspace + - uses: ./.github/actions/setup_env # Check for any formatting issues in the code. - run: dart format --set-exit-if-changed . @@ -20,4 +20,4 @@ jobs: - run: dart analyze . # Run widget tests for our flutter project. - # - run: flutter test + # - run: flutter test \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 011bc2bf..44156afd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,8 +18,8 @@ jobs: steps: - uses: actions/checkout@v4 - # Call setup_env workflow to setup workspace - - uses: ./.github/workflows/setup_env.yml + # Call setup_env action to setup workspace + - uses: ./.github/actions/setup_env # Generate keystore - uses: timheuer/base64-to-file@v1.2 diff --git a/.github/workflows/setup_env.yml b/.github/workflows/setup_env.yml deleted file mode 100644 index c27cc729..00000000 --- a/.github/workflows/setup_env.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Setup ENV - -on: - workflow_call: - -jobs: - setup_env: - runs-on: ubuntu-latest - - steps: - # 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