[build] set exec bits for kokoro scripts #508
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: presubmit | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Job 1: Build Plugin | |
| build-plugin: | |
| runs-on: ubuntu-large | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 # Use the latest stable version of actions/checkout | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 # 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-large, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} # Use the OS from the matrix | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 # Use the latest stable version of actions/checkout | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 # 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: Verify Plugin | |
| verify-plugin: | |
| needs: build-plugin | |
| strategy: | |
| matrix: | |
| # TODO(pq): temporarily reduced to address IO exceptions (https://github.com/flutter/dart-intellij-third-party/issues/220) | |
| # os: [ ubuntu-large, macos-latest, windows-latest ] | |
| os: [ ubuntu-large ] | |
| runs-on: ${{ matrix.os }} # Use the OS from the matrix | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 # Use the latest stable version of actions/checkout | |
| - name: Free up disk space (on ubuntu only) | |
| if: ${{ matrix.os == 'uubuntu-large' }} | |
| # Inspired by the https://github.com/marketplace/actions/free-disk-space-ubuntu action | |
| # See: https://github.com/flutter/dart-intellij-third-party/issues/220 | |
| run: | | |
| echo "Freeing disk space...\n" | |
| echo "Before:\n" | |
| df -h | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| echo "After:\n" | |
| df -h | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 # 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 | |
| - name: Upload verifier results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: build | |
| path: | | |
| **/build/reports/ | |
| **/build/test-results/ | |
| - name: Check baselines | |
| run: | | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' | |
| BOLD='\033[1m' | |
| NC='\033[0m' # None (Reset) | |
| EXIT_STATUS=0 | |
| for version in 251 252 253 261; do | |
| echo -e "${BOLD}Checking baseline for $version...${NC}" | |
| BASELINE="third_party/tool/baseline/$version/verifier-baseline.txt" | |
| REPORT=$(find third_party/build/reports/pluginVerifier -path "*-$version.*/report.md" | head -n 1) | |
| echo "Found report: $REPORT" | |
| if [ -f "$REPORT" ]; then | |
| echo "Comparing baseline against report in $REPORT" | |
| grep "^*" "$REPORT" | sort > current_issues.tmp || true | |
| if [ -f "$BASELINE" ]; then | |
| NEW_ERRORS=$(comm -13 <(sort "$BASELINE") current_issues.tmp) | |
| if [ -n "$NEW_ERRORS" ]; then | |
| echo -e "${RED}${BOLD}Error: New verification issues found for version $version:${NC}" | |
| echo "$NEW_ERRORS" | |
| EXIT_STATUS=1 | |
| else | |
| echo -e "${GREEN}Verification passed for version $version (no new issues).${NC}" | |
| fi | |
| else | |
| echo -e "${YELLOW}Warning: No baseline file found at $BASELINE. Skipping comparison.${NC}" | |
| fi | |
| else | |
| echo -e "${RED}${BOLD}Error: Report does not exist.${NC}" | |
| EXIT_STATUS=1 | |
| fi | |
| done | |
| if [ $EXIT_STATUS -ne 0 ]; then | |
| echo -e "${RED}${BOLD}Build failed: New verification issues were detected.${NC}" | |
| exit 1 | |
| fi |