Skip to content

Exclude JetBrains Annotations from published plugin dependencies #1580

Exclude JetBrains Annotations from published plugin dependencies

Exclude JetBrains Annotations from published plugin dependencies #1580

Workflow file for this run

name: Ubuntu CI
# Triggers:
# * push to a default or release-line branch — those ending in `master` or
# `main`, the same set `increment-guard.yml` guards as PR bases (e.g.
# `master`, `2.x-jdk8-master`). These post-merge runs are the only source
# of base-branch coverage, since `Publish` runs `publish -x test` and
# uploads none; `target: auto` in `.codecov.yml` compares each pull request
# against its base baseline.
# * pull_request — gates a change on its merge result, not the branch tip.
on:
push:
branches:
- '**master'
- '**main'
pull_request:
jobs:
build:
name: Build on Ubuntu
runs-on: ubuntu-latest
concurrency: # Avoid canceling in-progress runs for the same branch.
group: ubuntu-ci-${{ github.ref }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v6
with:
submodules: 'true'
- uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
- uses: gradle/actions/setup-gradle@v6
# Mirrors the pagefile step in build-on-windows.yml. The Linux runner
# ships with effectively no swap, so a memory peak becomes an instant
# OOM kill; this gives the kernel somewhere to fall back to.
- name: Add swap space
uses: pierotofy/set-swap-space@v1.0
with:
swap-size-gb: 8
- name: Build project, run tests
shell: bash
run: ./gradlew build --stacktrace
# `build` does not run Dokka — its tasks are gated to the publishing
# graph — so `dokkaGenerate` is appended to surface documentation
# warnings before merge, instead of only in the post-merge `Publish`
# job. `failOnWarning` is enabled in the Dokka setup.
- name: Check documentation
run: ./gradlew dokkaGenerate --stacktrace
# See: https://github.com/marketplace/actions/junit-report-action
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4.0.3
if: always() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/**/TEST-*.xml'
require_tests: true # will fail workflow if test reports not found
# Probe whether the upload token is available without exposing its value
# to the build/test steps. Scoping `CODECOV_TOKEN` to this trivial step
# (and to the upload step's `with.token`) keeps PR-authored code in
# `./gradlew build` from ever seeing the secret. The `secrets` context is
# not available in a step `if:`, so the upload gates on this output.
- name: Detect Codecov token
id: codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
if [ -n "$CODECOV_TOKEN" ]; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
fi
# On `push` (master) always upload — these runs are the only source of
# the `target: auto` baseline, so an absent token there is a
# misconfiguration that should fail loudly rather than silently stop
# refreshing coverage. On `pull_request`, skip when the token is absent:
# forked and Dependabot PRs run without secrets, and `fail_ci_if_error`
# would otherwise redden a healthy PR (coverage gating is meaningless
# there anyway).
- name: Upload code coverage report
if: steps.codecov.outputs.available == 'true' || github.event_name == 'push'
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true