From 92a3a4ac1a25bafad8c984942bc00ede3c1874b5 Mon Sep 17 00:00:00 2001 From: Stargator Date: Mon, 23 Dec 2024 10:25:01 -0500 Subject: [PATCH 1/2] GitHub Actions: Split Format Check into separate action --- .github/workflows/format-check.yml | 36 ++++++++++++++++++++++++++++++ .github/workflows/test.yml | 9 +------- 2 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/format-check.yml diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml new file mode 100644 index 00000000..cdca614e --- /dev/null +++ b/.github/workflows/format-check.yml @@ -0,0 +1,36 @@ +name: Check Formatting + +on: + pull_request: + paths: + - '.github/workflows/test.yml' + - 'bin/*.dart' + - 'exercises/**/*.dart' + - 'exercises/**/analysis_options.yaml' + - 'exercises/**/pubspec.yaml' + - 'lib/*.dart' + - 'lib/src/*.dart' + - 'test/*.dart' + - 'analysis_options.yaml' + - 'pubspec.*' + +jobs: + test: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + tag: ['3.2'] + + container: + image: dart:${{ matrix.tag }} + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + + - name: Install dependencies + run: dart pub get + + - name: Check Stage formatting + run: dart run bin/check_formatting.dart + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fb6cb311..9ed7922b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test +name: Run Tests on: pull_request: @@ -31,12 +31,5 @@ jobs: - name: Install dependencies run: dart pub get - - name: Check Stage formatting - run: dart run bin/check_formatting.dart - - # We can't check the exercises because they will produce errors since the example files have the solution. - - name: Analyze Dart code - run: dart analyze bin/ lib/ test/ - - name: Run tests run: dart test From 47b9c1468be61673cc994061af5434ee49bf5211 Mon Sep 17 00:00:00 2001 From: Stargator Date: Mon, 23 Dec 2024 10:25:12 -0500 Subject: [PATCH 2/2] GitHub Actions: Split Analyze Code into separate action --- .github/workflows/analyze-code.yml | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/analyze-code.yml diff --git a/.github/workflows/analyze-code.yml b/.github/workflows/analyze-code.yml new file mode 100644 index 00000000..40d64b98 --- /dev/null +++ b/.github/workflows/analyze-code.yml @@ -0,0 +1,36 @@ +name: Analyze Code + +on: + pull_request: + paths: + - '.github/workflows/test.yml' + - 'bin/*.dart' + - 'exercises/**/*.dart' + - 'exercises/**/analysis_options.yaml' + - 'exercises/**/pubspec.yaml' + - 'lib/*.dart' + - 'lib/src/*.dart' + - 'test/*.dart' + - 'analysis_options.yaml' + - 'pubspec.*' + +jobs: + test: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + tag: ['3.2'] + + container: + image: dart:${{ matrix.tag }} + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + + - name: Install dependencies + run: dart pub get + + # We can't check the exercises because they will produce errors since the example files have the solution. + - name: Analyze Dart code + run: dart analyze bin/ lib/ test/