Skip to content

[tests] add test and problem report uploading to the server test work… #231

[tests] add test and problem report uploading to the server test work…

[tests] add test and problem report uploading to the server test work… #231

Workflow file for this run

name: presubmit
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
# Job 1: Build Plugin
build-plugin:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4 # Use the latest stable version of actions/checkout
- name: Set up JDK
uses: actions/setup-java@v4 # https://github.com/marketplace/actions/setup-java-jdk
with:
distribution: 'temurin' # Recommended distribution
java-version: '21' # Match version in build.gradle.kts
cache: 'gradle' # Cache Gradle dependencies
- name: Build Plugin Action
run: ./gradlew buildPlugin
working-directory: third_party
# Job 2: Unit Tests
unit-tests:
needs: build-plugin
strategy:
matrix:
# TODO(https://github.com/flutter/dart-intellij-third-party/pull/33) Fix and enable execution on Windows
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }} # Use the OS from the matrix
steps:
- name: Checkout code
uses: actions/checkout@v4 # Use the latest stable version of actions/checkout
- name: Set up JDK
uses: actions/setup-java@v4 # https://github.com/marketplace/actions/setup-java-jdk
with:
distribution: 'temurin' # Recommended distribution
java-version: '21' # Match version in build.gradle.kts
cache: 'gradle' # Cache Gradle dependencies
- name: Unit Test Action
run: ./gradlew :test --tests "com.jetbrains.lang.dart.*"
working-directory: third_party
# Job 3: Dart Analysis Server Tests
dart-analysis-server-tests:
needs: build-plugin
strategy:
matrix:
# https://github.com/dart-lang/setup-dart
# Define the Dart SDK versions to test against.
# 'stable' and 'beta' will fetch the latest respective versions.
# You can also specify exact versions like '3.0.0', '3.8.1'.
# dart-version: ['3.0.0', 'stable', 'beta', 'dev' ]
# TODO(https://github.com/flutter/dart-intellij-third-party/issues/47)
# Fix tests to run over additional operating systems as well as Dart SDK versions:
dart-version: ['stable']
os: [ macos-latest ]
runs-on: ${{ matrix.os }} # Use the OS from the matrix
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
- name: Set up Dart SDK ${{ matrix.dart-version }}
# This action installs the specified Dart SDK version.
# It sets the DART_SDK environment variable to the SDK root.
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.dart-version }}
- name: Run Dart Analysis Server Tests with Dart SDK ${{ matrix.dart-version }}
if: always() # Run even if one SDK version fails
# Pass the Dart SDK path with DART_HOME
run: |
./gradlew :test --tests "com.jetbrains.dart.analysisServer.*"
working-directory: third_party
- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: build
path: |
**/build/reports/
**/build/test-results/
# Job 4: Verify Plugin
verify-plugin:
needs: build-plugin
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }} # Use the OS from the matrix
steps:
- name: Checkout code
uses: actions/checkout@v4 # Use the latest stable version of actions/checkout
- name: Set up JDK
uses: actions/setup-java@v4 # https://github.com/marketplace/actions/setup-java-jdk
with:
distribution: 'temurin' # Recommended distribution
java-version: '21' # Match version in build.gradle.kts
cache: 'gradle' # Cache Gradle dependencies
- name: Verify Plugin Actions
run: |
./gradlew verifyPlugin
./gradlew verifyPluginProjectConfiguration
./gradlew verifyPluginSignature
./gradlew verifyPluginStructure
working-directory: third_party