From 09769bf0cc3c36dde3ff38be1519d5643a4c7407 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 20 Apr 2023 15:43:56 +0200 Subject: [PATCH 1/4] [CI] Merge workflows --- .github/workflows/c_compiler.yaml | 89 ------------------- .../{native_assets_cli.yaml => dart.yaml} | 21 ++--- 2 files changed, 11 insertions(+), 99 deletions(-) delete mode 100644 .github/workflows/c_compiler.yaml rename .github/workflows/{native_assets_cli.yaml => dart.yaml} (81%) diff --git a/.github/workflows/c_compiler.yaml b/.github/workflows/c_compiler.yaml deleted file mode 100644 index 6d244290ef..0000000000 --- a/.github/workflows/c_compiler.yaml +++ /dev/null @@ -1,89 +0,0 @@ -name: package:c_compiler -permissions: read-all - -on: - pull_request: - branches: [main] - paths: - - ".github/workflows/c_compiler.yml" - - "pkgs/c_compiler/**" - - "pkgs/native_assets_cli/**" # Direct import. - push: - branches: [main] - paths: - - ".github/workflows/c_compiler.yml" - - "pkgs/c_compiler/**" - - "pkgs/native_assets_cli/**" # Direct import. - schedule: - - cron: "0 0 * * 0" # weekly - -jobs: - build: - strategy: - matrix: - os: [ubuntu, macos] - sdk: [stable, dev] - exclude: - # Only run analyze against dev on one host. - - os: macos - sdk: dev - - runs-on: ${{ matrix.os }}-latest - - defaults: - run: - working-directory: pkgs/c_compiler - - steps: - - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - - - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f - with: - sdk: ${{ matrix.sdk }} - - - uses: nttld/setup-ndk@deccd078bf3db957dbdee9862f51955b35ac81dd - with: - ndk-version: r25b - if: ${{ matrix.sdk == 'stable' }} - - - run: dart pub get - - - run: dart analyze --fatal-infos - # Run on dev to ensure we're not depending on deprecated SDK things. - - - run: dart format --output=none --set-exit-if-changed . - if: ${{ matrix.sdk == 'stable' }} - - - name: Install native toolchains - run: sudo apt-get install clang-14 gcc-i686-linux-gnu gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf - if: ${{ matrix.sdk == 'stable' && matrix.os == 'ubuntu' }} - - - run: dart test - if: ${{ matrix.sdk == 'stable' }} - - - name: Install coverage - run: dart pub global activate coverage - if: ${{ matrix.sdk == 'stable' }} - - - name: Collect coverage - run: dart pub global run coverage:test_with_coverage - if: ${{ matrix.sdk == 'stable' }} - - - name: Upload coverage - uses: coverallsapp/github-action@67662d24394fd74bffcf7b462d1b432814159afd - with: - flag-name: c_compiler-${{ matrix.os }} - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel: true - path-to-lcov: ./pkgs/c_compiler/coverage/lcov.info - if: ${{ matrix.sdk == 'stable' }} - - coverage-finished: - needs: [build] - runs-on: ubuntu-latest - steps: - - name: Upload coverage - uses: coverallsapp/github-action@67662d24394fd74bffcf7b462d1b432814159afd - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel-finished: true diff --git a/.github/workflows/native_assets_cli.yaml b/.github/workflows/dart.yaml similarity index 81% rename from .github/workflows/native_assets_cli.yaml rename to .github/workflows/dart.yaml index 8701c5c391..f233aef099 100644 --- a/.github/workflows/native_assets_cli.yaml +++ b/.github/workflows/dart.yaml @@ -1,19 +1,17 @@ -name: package:native_assets_cli +name: dart permissions: read-all on: pull_request: branches: [main] paths: - - ".github/workflows/native_assets_cli.yml" - - "pkgs/c_compiler/**" # Direct import of example. - - "pkgs/native_assets_cli/**" + - ".github/workflows/dart.yml" + - "pkgs/**" push: branches: [main] paths: - - ".github/workflows/native_assets_cli.yml" - - "pkgs/c_compiler/**" # Direct import of example. - - "pkgs/native_assets_cli/**" + - ".github/workflows/dart.yml" + - "pkgs/**" schedule: - cron: "0 0 * * 0" # weekly @@ -23,6 +21,7 @@ jobs: matrix: os: [ubuntu, macos] sdk: [stable, dev] + package: [c_compiler, native_assets_cli] exclude: # Only run analyze against dev on one host. - os: macos @@ -32,7 +31,7 @@ jobs: defaults: run: - working-directory: pkgs/native_assets_cli + working-directory: pkgs/${{ matrix.package }} steps: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 @@ -47,8 +46,10 @@ jobs: if: ${{ matrix.sdk == 'stable' }} - run: dart pub get + - run: dart pub get working-directory: pkgs/native_assets_cli/example/native_add/ + if: ${{ matrix.package == 'native_assets_cli' }} - run: dart analyze --fatal-infos # Run on dev to ensure we're not depending on deprecated SDK things. @@ -74,10 +75,10 @@ jobs: - name: Upload coverage uses: coverallsapp/github-action@67662d24394fd74bffcf7b462d1b432814159afd with: - flag-name: native_assets_cli-${{ matrix.os }} + flag-name: ${{ matrix.package }}-${{ matrix.os }} github-token: ${{ secrets.GITHUB_TOKEN }} parallel: true - path-to-lcov: ./pkgs/native_assets_cli/coverage/lcov.info + path-to-lcov: ./pkgs/${{ matrix.package }}/coverage/lcov.info if: ${{ matrix.sdk == 'stable' }} coverage-finished: From b098ff1027ef8965fbe87e2d408a3db5c7b06ada Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 20 Apr 2023 15:47:25 +0200 Subject: [PATCH 2/4] try not renaming --- .github/workflows/{dart.yaml => native_assets_cli.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{dart.yaml => native_assets_cli.yaml} (100%) diff --git a/.github/workflows/dart.yaml b/.github/workflows/native_assets_cli.yaml similarity index 100% rename from .github/workflows/dart.yaml rename to .github/workflows/native_assets_cli.yaml From 71d84612ff0142d5ea12e2a31956471b97874ae9 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 20 Apr 2023 15:48:29 +0200 Subject: [PATCH 3/4] try not renaming --- .github/workflows/native_assets_cli.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/native_assets_cli.yaml b/.github/workflows/native_assets_cli.yaml index f233aef099..5283ae5214 100644 --- a/.github/workflows/native_assets_cli.yaml +++ b/.github/workflows/native_assets_cli.yaml @@ -5,12 +5,12 @@ on: pull_request: branches: [main] paths: - - ".github/workflows/dart.yml" + - ".github/workflows/native_assets_cli.yaml" - "pkgs/**" push: branches: [main] paths: - - ".github/workflows/dart.yml" + - ".github/workflows/native_assets_cli.yaml" - "pkgs/**" schedule: - cron: "0 0 * * 0" # weekly From 7a976844560a5799fd6becb4e8f223d2305a7908 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 20 Apr 2023 15:49:15 +0200 Subject: [PATCH 4/4] rename with correct paths --- .github/workflows/{native_assets_cli.yaml => dart.yaml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{native_assets_cli.yaml => dart.yaml} (96%) diff --git a/.github/workflows/native_assets_cli.yaml b/.github/workflows/dart.yaml similarity index 96% rename from .github/workflows/native_assets_cli.yaml rename to .github/workflows/dart.yaml index 5283ae5214..d2359ea4da 100644 --- a/.github/workflows/native_assets_cli.yaml +++ b/.github/workflows/dart.yaml @@ -5,12 +5,12 @@ on: pull_request: branches: [main] paths: - - ".github/workflows/native_assets_cli.yaml" + - ".github/workflows/dart.yaml" - "pkgs/**" push: branches: [main] paths: - - ".github/workflows/native_assets_cli.yaml" + - ".github/workflows/dart.yaml" - "pkgs/**" schedule: - cron: "0 0 * * 0" # weekly