From 9443ccd4113278d60718c052cd875d8f6ec3ecb8 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Tue, 7 Nov 2023 13:35:41 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Reusable=20bootstrap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci_reuse_bootstrap.yml | 31 ++++++++++++++++++++++++ .github/workflows/tests.yml | 19 ++------------- 2 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/ci_reuse_bootstrap.yml diff --git a/.github/workflows/ci_reuse_bootstrap.yml b/.github/workflows/ci_reuse_bootstrap.yml new file mode 100644 index 000000000..6016b21f3 --- /dev/null +++ b/.github/workflows/ci_reuse_bootstrap.yml @@ -0,0 +1,31 @@ +name: CI Reusable Bootstrap + +on: + workflow_call: + inputs: + flutter-version: + required: true + type: string + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2.8.0 + with: + cache: true + flutter-version: ${{ inputs.flutter-version == 'min' && '2.8.0' || '' }} + channel: ${{ inputs.flutter-version == && 'min' || inputs.flutter-version }} + - run: | + chmod +x ./scripts/prepare_pinning_certs.sh + ./scripts/prepare_pinning_certs.sh + shell: bash + - name: Install proxy for tests + run: sudo apt-get install -y squid + - run: dart pub get + - uses: bluefireteam/melos-action@v2 + with: + run-bootstrap: false + - run: melos run files-patch + - run: melos run pre-bootstrap diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 71669a6ba..891c7472b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,22 +22,7 @@ jobs: matrix: sdk: [ min, stable, beta ] steps: - - uses: actions/checkout@v3 - - uses: subosito/flutter-action@v2.8.0 + - uses: ./ci_reuse_bootstrap.yml with: - cache: true - flutter-version: ${{ matrix.sdk == 'min' && '2.8.0' || '' }} - channel: ${{ matrix.sdk == 'min' && '' || matrix.channel }} - - run: | - chmod +x ./scripts/prepare_pinning_certs.sh - ./scripts/prepare_pinning_certs.sh - shell: bash - - name: Install proxy for tests - run: sudo apt-get install -y squid - - run: dart pub get - - uses: bluefireteam/melos-action@v2 - with: - run-bootstrap: false - - run: melos run files-patch - - run: melos run pre-bootstrap + flutter-version: ${{ matrix.sdk }} - run: melos run github-ci