From 85d3ef0ebeb35dc8e2e3b888f85205854878e47c Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:46:03 -0300 Subject: [PATCH] refactor pipelines --- .github/actions/fvm/action.yml | 31 +++++++++++++++++++++ .github/actions/test/action.yml | 34 +++++++++++------------ .github/workflows/analyze.yml | 49 +++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 17 deletions(-) create mode 100644 .github/actions/fvm/action.yml create mode 100644 .github/workflows/analyze.yml diff --git a/.github/actions/fvm/action.yml b/.github/actions/fvm/action.yml new file mode 100644 index 000000000..15018e44a --- /dev/null +++ b/.github/actions/fvm/action.yml @@ -0,0 +1,31 @@ +name: "Setup FVM" +description: "Install and setup FVM" + +inputs: + flutter-version: + description: 'Flutter version' + required: false + default: "" + +runs: + using: "composite" + steps: + - name: Install FVM + shell: bash + run: | + curl -fsSL https://fvm.app/install.sh | bash + fvm use ${{ inputs.flutter-version }} --force + + + - uses: kuhnroyal/flutter-fvm-config-action@v2 + id: fvm-config-action + + - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} + channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} + + - name: Flutter version + shell: bash + run: flutter --version + \ No newline at end of file diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 3edd93075..63b99bf3c 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -54,24 +54,24 @@ runs: run: melos run test shell: bash - - name: Install DCM - if: ${{ inputs.run-dcm }} - uses: CQLabs/setup-dcm@v1 - with: - github_token: ${{ inputs.token }} - folders: packages/*/lib + # - name: Install DCM + # if: ${{ inputs.run-dcm }} + # uses: CQLabs/setup-dcm@v1 + # with: + # github_token: ${{ inputs.token }} + # folders: packages/*/lib - - name: Run DCM - if: ${{ inputs.run-dcm }} - uses: CQLabs/dcm-action@v1 - with: - github_token: ${{ inputs.token }} - ci_key: oss - email: oss - folders: . - fatal_style: true - fatal_performance: true - fatal_warnings: true + # - name: Run DCM + # if: ${{ inputs.run-dcm }} + # uses: CQLabs/dcm-action@v1 + # with: + # github_token: ${{ inputs.token }} + # ci_key: oss + # email: oss + # folders: . + # fatal_style: true + # fatal_performance: true + # fatal_warnings: true - name: Run fixes run: melos run fix diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml new file mode 100644 index 000000000..5b685da3f --- /dev/null +++ b/.github/workflows/analyze.yml @@ -0,0 +1,49 @@ +name: Analyze Workflow + +on: + push: + pull_request_target: + branches: [main] + paths-ignore: + - 'scripts/**' + - 'website/**' + - 'assets/**' + +jobs: + dcm: + name: DCM + runs-on: ubuntu-latest + steps: + - name: Checkout mix repo + uses: actions/checkout@v4 + + - name: Setup FVM + uses: ./.github/actions/fvm/ + + - name: Setup Melos + uses: bluefireteam/melos-action@v3 + + - name: Run build runner + shell: bash + run: melos run brb + + - name: Install DCM + if: ${{ inputs.run-dcm }} + uses: CQLabs/setup-dcm@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + folders: packages/*/lib + ci_key: oss + email: oss + fatal_style: true + fatal_performance: true + fatal_warnings: true + + - name: dart analyze + run: melos run --no-select analyze + shell: bash + + - name: Run custom_lint + run: melos run custom_lint_analyze + shell: bash + \ No newline at end of file