From e390cedf364c65e61623aaffbdb9359bd3e090bf Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Tue, 4 Oct 2022 11:02:22 +0200 Subject: [PATCH] ci: update and pin GHA to a commit hash (#1044) Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> --- .github/workflows/dart.yml | 77 +++++----- .github/workflows/dio.yml | 47 +++--- .github/workflows/e2e_dart.yml | 20 +-- .github/workflows/flutter.yml | 170 +++++++++++----------- .github/workflows/logging.yml | 50 +++---- .github/workflows/min_version_test.yml | 28 ++-- .github/workflows/web-example-ghpages.yml | 4 +- 7 files changed, 195 insertions(+), 201 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 39eb7f9da6..d689f5c67a 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -27,48 +27,47 @@ jobs: - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@v1 - with: - sdk: ${{ matrix.sdk }} - - uses: actions/checkout@v3 - # coverage with 'chrome' platform hangs the build - - name: Test (VM and browser) - if: runner.os != 'macOS' - run: | - dart pub get - dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces - dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces - dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 + with: + sdk: ${{ matrix.sdk }} + - uses: actions/checkout@v3 + # coverage with 'chrome' platform hangs the build + - name: Test (VM and browser) + if: runner.os != 'macOS' + run: | + dart pub get + dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces + dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces + dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib - - name: Install webdev - run: dart pub global activate webdev + - name: Install webdev + run: dart pub global activate webdev - - name: Build example - run: | - cd example - dart pub get - dart compile exe bin/example.dart + - name: Build example + run: | + cd example + dart pub get + dart compile exe bin/example.dart - # if condition because of: The pubspec.lock file has changed since the .dart_tool/package_config.json file was generated, please run "pub get" again. - - name: Build Web example - if: runner.os != 'Windows' - run: | - cd example_web - dart pub get - webdev build + # if condition because of: The pubspec.lock file has changed since the .dart_tool/package_config.json file was generated, please run "pub get" again. + - name: Build Web example + if: runner.os != 'Windows' + run: | + cd example_web + dart pub get + webdev build - - uses: codecov/codecov-action@v2 - if: runner.os == 'Linux' && matrix.sdk == 'stable' - with: - name: sentry - files: ./dart/coverage/lcov.info + - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 + if: runner.os == 'Linux' && matrix.sdk == 'stable' + with: + name: sentry + files: ./dart/coverage/lcov.info - # 1.2.1 - - uses: VeryGoodOpenSource/very_good_coverage@feed99cc060453828a8f12e74b404baace8e4502 - if: runner.os == 'Linux' && matrix.sdk == 'stable' - with: - path: "./dart/coverage/lcov.info" - min_coverage: 85 + - uses: VeryGoodOpenSource/very_good_coverage@feed99cc060453828a8f12e74b404baace8e4502 # pin@v1.2.1 + if: runner.os == 'Linux' && matrix.sdk == 'stable' + with: + path: './dart/coverage/lcov.info' + min_coverage: 85 analyze: runs-on: ubuntu-latest @@ -77,7 +76,7 @@ jobs: run: working-directory: ./dart steps: - - uses: dart-lang/setup-dart@v1 + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 with: sdk: stable - uses: actions/checkout@v3 @@ -91,7 +90,7 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v3 - - uses: axel-op/dart-package-analyzer@v3 + - uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3 id: analysis with: githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/dio.yml b/.github/workflows/dio.yml index 075cc15461..5ffe5c9c5e 100644 --- a/.github/workflows/dio.yml +++ b/.github/workflows/dio.yml @@ -27,30 +27,29 @@ jobs: - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@v1 - with: - sdk: ${{ matrix.sdk }} - - uses: actions/checkout@v3 - # coverage with 'chrome' platform hangs the build - - name: Test (VM and browser) - run: | - dart pub get - dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces - dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces - dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 + with: + sdk: ${{ matrix.sdk }} + - uses: actions/checkout@v3 + # coverage with 'chrome' platform hangs the build + - name: Test (VM and browser) + run: | + dart pub get + dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces + dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces + dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib - - uses: codecov/codecov-action@v2 - if: runner.os == 'Linux' && matrix.sdk == 'stable' - with: - name: sentry_dio - files: ./dio/coverage/lcov.info + - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 + if: runner.os == 'Linux' && matrix.sdk == 'stable' + with: + name: sentry_dio + files: ./dio/coverage/lcov.info - # 1.2.1 - - uses: VeryGoodOpenSource/very_good_coverage@feed99cc060453828a8f12e74b404baace8e4502 - if: runner.os == 'Linux' && matrix.sdk == 'stable' - with: - path: "./dio/coverage/lcov.info" - min_coverage: 81 + - uses: VeryGoodOpenSource/very_good_coverage@feed99cc060453828a8f12e74b404baace8e4502 # pin@v1.2.1 + if: runner.os == 'Linux' && matrix.sdk == 'stable' + with: + path: './dio/coverage/lcov.info' + min_coverage: 81 analyze: runs-on: ubuntu-latest @@ -59,7 +58,7 @@ jobs: run: working-directory: ./dio steps: - - uses: dart-lang/setup-dart@v1 + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 with: sdk: stable - uses: actions/checkout@v3 @@ -77,7 +76,7 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v3 - - uses: axel-op/dart-package-analyzer@v3 + - uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3 id: analysis with: githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/e2e_dart.yml b/.github/workflows/e2e_dart.yml index 5ac2e1f6c7..ec70dd20b1 100644 --- a/.github/workflows/e2e_dart.yml +++ b/.github/workflows/e2e_dart.yml @@ -26,15 +26,15 @@ jobs: matrix: sdk: [stable, beta] steps: - - uses: dart-lang/setup-dart@v1 - with: - sdk: ${{ matrix.sdk }} - - uses: actions/checkout@v3 - - name: Run - if: env.SENTRY_AUTH_TOKEN != null - run: | - dart pub get - dart run --define=SENTRY_ENVIRONMENT=e2e + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 + with: + sdk: ${{ matrix.sdk }} + - uses: actions/checkout@v3 + - name: Run + if: env.SENTRY_AUTH_TOKEN != null + run: | + dart pub get + dart run --define=SENTRY_ENVIRONMENT=e2e analyze: runs-on: ubuntu-latest @@ -43,7 +43,7 @@ jobs: run: working-directory: ./e2e_test steps: - - uses: dart-lang/setup-dart@v1 + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 with: sdk: stable - uses: actions/checkout@v3 diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index c72a751e01..1d75f40379 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -51,93 +51,92 @@ jobs: sdk: beta steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '8' - - # Install required dependencies for Flutter on Linux on Ubuntu - - name: 'Setup Linux' - run: | - sudo apt update - sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb - sudo apt install -y network-manager upower - if: matrix.os == 'ubuntu-latest' - - - uses: subosito/flutter-action@v2 - with: - channel: ${{ matrix.sdk }} - - - run: flutter upgrade - - - name: Pub Get - run: | - cd flutter - flutter pub get - - - name: Test chrome - if: runner.os == 'Linux' - run: | - cd flutter - flutter test --platform chrome --test-randomize-ordering-seed=random - - - name: Test VM with coverage - if: runner.os != 'macOS' - run: | - cd flutter - flutter test --coverage --test-randomize-ordering-seed=random - - # remove comment after https://github.com/codecov/codecov-action/issues/600 - # - uses: codecov/codecov-action@v2 - # if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' - # with: - # name: sentry_flutter - # file: ./flutter/coverage/lcov.info - - # 1.2.1 - - uses: VeryGoodOpenSource/very_good_coverage@feed99cc060453828a8f12e74b404baace8e4502 - if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' - with: - path: "./flutter/coverage/lcov.info" - min_coverage: 90 - - - name: Build ${{ matrix.target }} - run: | - flutter config --enable-windows-desktop - flutter config --enable-macos-desktop - flutter config --enable-linux-desktop - cd flutter/example - TARGET=${{ matrix.target }} - flutter pub get - case $TARGET in - ios) - flutter build ios --no-codesign - ;; - macos) - flutter build macos - ;; - android) - flutter build appbundle - ;; - web) - flutter build web - ;; - linux) - flutter build linux - ;; - windows) - flutter build windows - ;; - esac + - uses: actions/checkout@v3 + + - uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '8' + + # Install required dependencies for Flutter on Linux on Ubuntu + - name: 'Setup Linux' + run: | + sudo apt update + sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb + sudo apt install -y network-manager upower + if: matrix.os == 'ubuntu-latest' + + - uses: subosito/flutter-action@1e6ee87cb840500837bcd50a667fb28815d8e310 # pin@v2 + with: + channel: ${{ matrix.sdk }} + + - run: flutter upgrade + + - name: Pub Get + run: | + cd flutter + flutter pub get + + - name: Test chrome + if: runner.os == 'Linux' + run: | + cd flutter + flutter test --platform chrome --test-randomize-ordering-seed=random + + - name: Test VM with coverage + if: runner.os != 'macOS' + run: | + cd flutter + flutter test --coverage --test-randomize-ordering-seed=random + + # remove comment after https://github.com/codecov/codecov-action/issues/600 + # - uses: codecov/codecov-action@v2 + # if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + # with: + # name: sentry_flutter + # file: ./flutter/coverage/lcov.info + + - uses: VeryGoodOpenSource/very_good_coverage@feed99cc060453828a8f12e74b404baace8e4502 # pin@v1.2.1 + if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + with: + path: './flutter/coverage/lcov.info' + min_coverage: 90 + + - name: Build ${{ matrix.target }} + run: | + flutter config --enable-windows-desktop + flutter config --enable-macos-desktop + flutter config --enable-linux-desktop + cd flutter/example + TARGET=${{ matrix.target }} + flutter pub get + case $TARGET in + ios) + flutter build ios --no-codesign + ;; + macos) + flutter build macos + ;; + android) + flutter build appbundle + ;; + web) + flutter build web + ;; + linux) + flutter build linux + ;; + windows) + flutter build windows + ;; + esac analyze: runs-on: ubuntu-latest timeout-minutes: 20 steps: - uses: actions/checkout@v3 - - uses: subosito/flutter-action@v2 + - uses: subosito/flutter-action@1e6ee87cb840500837bcd50a667fb28815d8e310 # pin@v2 - run: | cd flutter flutter pub get @@ -153,7 +152,7 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v3 - - uses: axel-op/dart-package-analyzer@v3 + - uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3 id: analysis with: githubToken: ${{ secrets.GITHUB_TOKEN }} @@ -187,7 +186,7 @@ jobs: working-directory: ./flutter steps: - uses: actions/checkout@v3 - - uses: norio-nomura/action-swiftlint@3.2.1 + - uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@3.2.1 ktlint: runs-on: ubuntu-latest @@ -198,7 +197,7 @@ jobs: - uses: actions/checkout@v3 - name: ktlint - uses: ScaCap/action-ktlint@master + uses: ScaCap/action-ktlint@f22fa77f33cbfaf0a1a332aae1f176c8712c8a3c # pin@1.4 with: github_token: ${{ secrets.github_token }} reporter: github-pr-review @@ -208,8 +207,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # 1.20.0 # To recreate baseline run: detekt -i flutter/android,flutter/example/android -b flutter/config/detekt-bl.xml -cb - - uses: natiginfo/action-detekt-all@74990bda6bfc47977e1e06aae9f47f320e7587ce + - uses: natiginfo/action-detekt-all@e01de6ff0eef7c24131e8a133bf598cfac6ceeab # pin@1.21.0 with: args: -i flutter/android,flutter/example/android --baseline flutter/config/detekt-bl.xml diff --git a/.github/workflows/logging.yml b/.github/workflows/logging.yml index 404866c448..56f9618c3a 100644 --- a/.github/workflows/logging.yml +++ b/.github/workflows/logging.yml @@ -6,8 +6,8 @@ on: - release/** pull_request: paths-ignore: - - 'dio/**' - - 'flutter/**' + - 'dio/**' + - 'flutter/**' jobs: build: @@ -27,30 +27,28 @@ jobs: - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@v1 - with: - sdk: ${{ matrix.sdk }} - - uses: actions/checkout@v3 - # coverage with 'chrome' platform hangs the build - - name: Test (VM and browser) - run: | - dart pub get - dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces - dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces - dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 + with: + sdk: ${{ matrix.sdk }} + - uses: actions/checkout@v3 + # coverage with 'chrome' platform hangs the build + - name: Test (VM and browser) + run: | + dart pub get + dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces + dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces + dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib - - uses: codecov/codecov-action@v2 - if: runner.os == 'Linux' && matrix.sdk == 'stable' - with: - name: sentry_logging - files: ./logging/coverage/lcov.info + - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 + if: runner.os == 'Linux' && matrix.sdk == 'stable' + with: + name: sentry_logging + files: ./logging/coverage/lcov.info - # 1.2.1 - - uses: VeryGoodOpenSource/very_good_coverage@feed99cc060453828a8f12e74b404baace8e4502 - if: runner.os == 'Linux' && matrix.sdk == 'stable' - with: - path: "./logging/coverage/lcov.info" - min_coverage: 90 + - uses: VeryGoodOpenSource/very_good_coverage@feed99cc060453828a8f12e74b404baace8e4502 # pin@v1.2.1 if: runner.os == 'Linux' && matrix.sdk == 'stable' + with: + path: './logging/coverage/lcov.info' + min_coverage: 90 analyze: runs-on: ubuntu-latest @@ -59,7 +57,7 @@ jobs: run: working-directory: ./logging steps: - - uses: dart-lang/setup-dart@v1 + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 with: sdk: stable - uses: actions/checkout@v3 @@ -77,7 +75,7 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v3 - - uses: axel-op/dart-package-analyzer@v3 + - uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3 id: analysis with: githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/min_version_test.yml b/.github/workflows/min_version_test.yml index 57bf59cbc6..8685cc7697 100644 --- a/.github/workflows/min_version_test.yml +++ b/.github/workflows/min_version_test.yml @@ -13,20 +13,20 @@ jobs: timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '11' + - uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '11' - - uses: subosito/flutter-action@v2 - with: - flutter-version: '2.0.0' + - uses: subosito/flutter-action@1e6ee87cb840500837bcd50a667fb28815d8e310 # pin@v2 + with: + flutter-version: '2.0.0' - - name: Build - run: | - cd min_version_test - flutter pub get - flutter build ios --no-codesign - flutter build appbundle + - name: Build + run: | + cd min_version_test + flutter pub get + flutter build ios --no-codesign + flutter build appbundle diff --git a/.github/workflows/web-example-ghpages.yml b/.github/workflows/web-example-ghpages.yml index e295b8e0e9..6b277f20fe 100644 --- a/.github/workflows/web-example-ghpages.yml +++ b/.github/workflows/web-example-ghpages.yml @@ -13,8 +13,8 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: subosito/flutter-action@v2 - - uses: erickzanardo/flutter-gh-pages@66e3e7b317d4fef824b2cfd3c9a4a112d321f33d + - uses: subosito/flutter-action@1e6ee87cb840500837bcd50a667fb28815d8e310 # pin@v2 + - uses: bluefireteam/flutter-gh-pages@57815b17b371455ec1a98f075b71b4c6ba0a938c # pin@v8 with: workingDir: flutter/example customArgs: --source-maps