diff --git a/.github/workflows/common-tests.yml b/.github/workflows/common-tests.yml new file mode 100644 index 00000000..a6a5cb7a --- /dev/null +++ b/.github/workflows/common-tests.yml @@ -0,0 +1,41 @@ +name: Common Tests + +on: + workflow_call: + +jobs: + test: + name: "${{ matrix.os }}" + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + sdk-version: [stable] + include: + - os: macOS-latest + TARGET: macos + - os: ubuntu-latest + TARGET: linux + - os: windows-latest + TARGET: windows + + steps: + - uses: actions/checkout@v1 + - uses: dart-lang/setup-dart@v1.5.0 + - name: Cache Dart dependencies + uses: actions/cache@v2 + with: + path: "~/.pub-cache" + key: ${{ runner.os }}-dart-${{ hashFiles('**/pubspec.lock') }} + restore-keys: | + ${{ runner.os }}-dart- + + - run: dart pub get + + - run: ./scripts/build_version.dart + - run: dart analyze --fatal-infos --fatal-warnings . + + - name: Generate git cache + run: ./bin/fvm.dart install master + + - run: dart test diff --git a/.github/workflows/deploy_chocolatey.yaml b/.github/workflows/deploy_chocolatey.yaml index 37c6500f..58fae265 100644 --- a/.github/workflows/deploy_chocolatey.yaml +++ b/.github/workflows/deploy_chocolatey.yaml @@ -17,7 +17,7 @@ jobs: env: CHOCOLATEY_TOKEN: ${{ secrets.CHOCOLATEY_TOKEN }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Setup Dart uses: DanTup/gh-actions/setup-dart@master @@ -27,11 +27,9 @@ jobs: - name: Install dependencies run: dart pub get - - name: Run Builder for Version - run: dart pub run build_runner build --delete-conflicting-outputs + - run: ./scripts/build_version.dart - - name: Run Test - run: dart pub run test + - run: dart pub run test - name: Deploy Chocolatey (Windows) run: dart pub run grinder pkg-chocolatey-deploy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a0c315f..8ff84052 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,7 @@ jobs: run: dart pub get - run: ./scripts/build_version.dart + - run: ./bin/fvm.dart install master - run: dart test release: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59af1695..9b201f8d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,37 +13,4 @@ concurrency: jobs: test: - name: "${{ matrix.os }}" - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, ubuntu-latest, macos-latest] - sdk-version: [stable] - include: - - os: macOS-latest - TARGET: macos - - os: ubuntu-latest - TARGET: linux - - os: windows-latest - TARGET: windows - - steps: - - uses: actions/checkout@v1 - - uses: dart-lang/setup-dart@v1.5.0 - - name: Cache Dart dependencies - uses: actions/cache@v2 - with: - path: "~/.pub-cache" - key: ${{ runner.os }}-dart-${{ hashFiles('**/pubspec.lock') }} - restore-keys: | - ${{ runner.os }}-dart- - - - run: dart pub get - - - run: ./scripts/build_verssion.dart - - run: dart analyze --fatal-infos --fatal-warnings . - - - name: Generate git cache - run: ./bin/fvm.dart install master - - - run: dart test + uses: ./.github/workflows/common-tests.yml