Skip to content

[JEWEL-1389] Optimize CircularProgressIndicator animation #1228

[JEWEL-1389] Optimize CircularProgressIndicator animation

[JEWEL-1389] Optimize CircularProgressIndicator animation #1228

Workflow file for this run

name: Jewel Checks
on:
pull_request:
paths:
- "platform/jewel/**"
# This workflow and the actions it depends on must run on changes to themselves, so that a change to the
# checks is validated by the checks it changes rather than by the next unrelated Jewel PR.
- ".github/workflows/jewel-checks.yml"
- ".github/actions/setup-kotlin/**"
defaults:
run:
working-directory: platform/jewel
# Kotlin used to run the .main.kts CI scripts (annotate/check API dumps, Metalava). It is pinned
# here so the scripts do not depend on whatever Kotlin the runner image happens to ship.
#
# When Jewel's build Kotlin is updated, bump KOTLIN_VERSION to match so CI and the build stay aligned.
# Keep it below 2.4.0 until the .main.kts cross-`@file:Import` regression is fixed (FIR crash
# "Expected FirResolvedTypeRef ... but was FirUserTypeRefImpl"); see JEWEL-1339.
env:
KOTLIN_VERSION: 2.3.20
jobs:
checks:
name: CI code checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
name: Check out repository
- name: Set up JBR 21
uses: actions/setup-java@v5.6.0
with:
java-version: 21
distribution: jetbrains
cache: gradle
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Run :check task
# Run checks for all modules except the IDE plugin sample, as that is bound to have missing APIs issues
run: ./gradlew check -x detekt --continue --no-daemon
- name: Annotate JUnit test failures
uses: mikepenz/action-junit-report@v6
if: failure()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
annotate_only: true # A forked repo cannot write comments, so just do annotations
- name: Upload JUnit test reports
uses: actions/upload-artifact@v7.0.1
if: failure()
with:
name: junit-test-results
path: '**/build/test-results/test/TEST-*.xml'
retention-days: 7
- name: Run detekt tasks
id: detekt
if: ${{ !cancelled() }}
# Run detekt checks for all modules except the IDE plugin sample, as that is bound to have missing APIs issues
run: ./gradlew detekt detektMain detektTest --continue --no-daemon
- name: Set up Kotlin ${{ env.KOTLIN_VERSION }}
id: kotlin
if: ${{ !cancelled() && steps.detekt.outcome != 'skipped' }}
uses: ./.github/actions/setup-kotlin
with:
version: ${{ env.KOTLIN_VERSION }}
- name: Annotate detekt findings
if: ${{ !cancelled() && steps.detekt.outcome != 'skipped' }}
# Turn detekt's checkstyle reports (main.xml from detektMain, test.xml from detektTest) into inline
# GitHub annotations on the PR's "Files changed" tab, plus a run summary. The failing detekt task is
# the gate; this is visibility. Works for fork PRs too (annotations, not API-driven comments).
run: ${{ steps.kotlin.outputs.bin-dir }}/kotlin ./scripts/annotate-detekt.main.kts
check_paths:
name: Check changed files
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
run_formalities: ${{ steps.filter.outputs.run_formalities }}
steps:
- uses: actions/checkout@v7.0.1
name: Check out repository
- uses: dorny/paths-filter@v4
name: Check which files are changed
id: filter
with:
filters: |
run_formalities:
- '!all(platform/jewel/ui/generated/org/jetbrains/jewel/ui/icons/AllIconsKeys.java)'
formalities:
name: PR formalities
runs-on: ubuntu-latest
needs: check_paths
if: needs.check_paths.outputs.run_formalities == 'true'
steps:
- uses: actions/checkout@v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha }}
name: Check out repository
- name: Grant execute permission to validation scripts
run: chmod +x ./scripts/validate-commit-message.sh && chmod +x ./scripts/validate-pr-commits.sh
- name: Validate PR has single commit
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: ./scripts/validate-pr-commits.sh
- name: Validate commit message
env:
GH_TOKEN: ${{ github.token }}
JEWEL_YT_TOKEN: ${{ secrets.JEWEL_YT_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: ./scripts/validate-commit-message.sh
annotate_breaking_api_changes:
name: Annotate breaking API changes with IJP dumps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
with:
# We need fetch-depth: '2' so we get HEAD~1 in case this is missing the PR token
fetch-depth: '2'
name: Check out repository
- name: Set up Kotlin ${{ env.KOTLIN_VERSION }}
id: kotlin
uses: ./.github/actions/setup-kotlin
with:
version: ${{ env.KOTLIN_VERSION }}
- name: Annotate breaking API changes
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ github.token }}
run: ${{ steps.kotlin.outputs.bin-dir }}/kotlin ./scripts/annotate-api-dump-changes.main.kts
check_ij_api_dumps:
name: Check that the IJP API dumps are up-to-date
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v7.0.1
name: Check out repository
# Bazel reads the whole JPS model, including the android modules, so the subrepo must be present
# even though the API check itself only looks at community modules.
- uses: actions/checkout@v7.0.1
name: Checkout JetBrains/android submodule
with:
repository: JetBrains/android
path: android
ref: master
# The API check compiles every community module, which does not fit a hosted runner's stock
# resources. Same preparation as .github/actions/build_ide, which builds the IDE on ubuntu-latest.
- name: Free disk space
# language=bash
run: |
echo "Disk space before cleanup:"
df -h /
# Pre-installed toolchains the API check doesn't need.
sudo rm -rf \
/usr/share/dotnet \
/usr/share/swift \
/usr/share/miniconda \
/usr/local/lib/android \
/usr/local/share/boost \
/usr/local/share/powershell \
/usr/local/share/chromium \
/usr/local/lib/node_modules \
/opt/ghc \
/opt/hostedtoolcache/CodeQL \
/opt/hostedtoolcache/Ruby \
/opt/hostedtoolcache/PyPy \
/opt/hostedtoolcache/go \
/opt/microsoft \
/opt/google \
/imagegeneration \
/var/cache/apt/archives
sudo apt-get -y clean
docker image prune --all --force || true
docker builder prune --all --force || true
echo "Disk space after cleanup:"
df -h /
- name: Expand swap
# language=bash
run: |
# Bazel's JVM workers may hit OOM (exit 137) with the default 16 GB RAM and 4 GB swap.
# /mnt on hosted runners has ~70 GB free, so move swap there and grow it.
sudo swapoff -a || true
sudo rm -f /mnt/swapfile /swapfile
sudo fallocate -l 30G /mnt/swapfile
sudo chmod 600 /mnt/swapfile
sudo mkswap /mnt/swapfile
sudo swapon /mnt/swapfile
free -h
- uses: actions/cache@v6.1.0
name: Cache for jps-bootstrap
with:
key: ${{ runner.os }}-jps-bootstrap-${{ hashFiles('platform/jps-bootstrap/**') }}
path: |
out
build/jps-bootstrap-work
build/download
- name: Set up Kotlin ${{ env.KOTLIN_VERSION }}
id: kotlin
uses: ./.github/actions/setup-kotlin
with:
version: ${{ env.KOTLIN_VERSION }}
- name: Check that the IJP API dumps are up-to-date
run: ${{ steps.kotlin.outputs.bin-dir }}/kotlin ./scripts/check-api-dumps.main.kts
working-directory: platform/jewel
check_bazel_build:
name: Check that the Bazel build is up-to-date
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v7.0.1
name: Check out repository
- uses: actions/checkout@v7.0.1
name: Checkout JetBrains/android submodule
with:
repository: JetBrains/android
path: android
ref: master
- name: Set up JBR 21
uses: actions/setup-java@v5.6.0
with:
java-version: 21
distribution: jetbrains
cache: gradle
- name: Grant execute permission to the Bazel build generator script
run: chmod +x build/jpsModelToBazelCommunityOnly.cmd
- name: Run the Bazel build generator script
run: ./build/jpsModelToBazelCommunityOnly.cmd
- name: Check that the Bazel build is up-to-date (except android submodule)
run: |
# 1. Get all changed files
# 2. Filter for Bazel files (extensions .bzl, .bazel, or filenames BUILD, WORKSPACE)
# 3. Exclude the android submodule
# 4. Keep only relevant files:
# - Top-level files (no slashes)
# - build/BUILD.bazel
# - Files in platform/jewel/
CHANGED_BAZEL_FILES=$(git diff --name-only HEAD \
| grep -E '\.(bzl|bazel)$|^BUILD|^WORKSPACE' \
| grep -v '^android/' \
| grep -E '^[^/]+$|^lib/(BUILD|MODULE).bazel$|^build/BUILD\.bazel$|^platform/jewel/' \
|| true)
if [ -n "$CHANGED_BAZEL_FILES" ]; then
echo "Error: Bazel files need to be updated:"
echo "$CHANGED_BAZEL_FILES"
echo "Run the jpsModelToBazelCommunityOnly.cmd script and commit the changes outside of the android submodule."
exit 1
fi
echo "Bazel build files look up-to-date."
metalava:
name: Check for breaking API changes with Metalava
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
name: Check out repository
- name: Set up JBR 21
uses: actions/setup-java@v5.6.0
with:
java-version: 21
distribution: jetbrains
cache: gradle
- name: Set up Kotlin ${{ env.KOTLIN_VERSION }}
id: kotlin
uses: ./.github/actions/setup-kotlin
with:
version: ${{ env.KOTLIN_VERSION }}
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Annotate breaking API changes
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ github.token }}
run: ${{ steps.kotlin.outputs.bin-dir }}/kotlin ./scripts/metalava-signatures.main.kts validate