diff --git a/.editorconfig b/.editorconfig index 2a4ad4ec1b55..b49a2d432075 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,17 @@ +root = true + +[*] +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.bat] +end_of_line = crlf + +[*.md] +# Trailing whitespace is important in Markdown (they distinguish a new line from a new paragraph) +trim_trailing_whitespace = false + [*.{kt,kts}] ij_kotlin_allow_trailing_comma = false ij_kotlin_allow_trailing_comma_on_call_site = false diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 57a6f10876d6..65eddb565fd1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -5,7 +5,7 @@ type: Bug labels: ["type: bug"] --- - + ## Steps to reproduce diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 93fa0b266326..eeb371ed465e 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,7 @@ blank_issues_enabled: false contact_links: - name: Ask a question - url: https://github.com/junit-team/junit5/discussions/categories/q-a + url: https://github.com/junit-team/junit-framework/discussions/categories/q-a about: Please ask and answer questions here - name: Ask a question (Stack Overflow) url: https://stackoverflow.com/questions/tagged/junit5 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 90d0d4bdaed2..36a9551af336 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,18 +1,16 @@ -## Overview - --- -I hereby agree to the terms of the [JUnit Contributor License Agreement](https://github.com/junit-team/junit5/blob/002a0052926ddee57cf90580fa49bc37e5a72427/CONTRIBUTING.md#junit-contributor-license-agreement). +I hereby agree to the terms of the [JUnit Contributor License Agreement](https://github.com/junit-team/junit-framework/blob/002a0052926ddee57cf90580fa49bc37e5a72427/CONTRIBUTING.md#junit-contributor-license-agreement). --- ### Definition of Done - [ ] There are no TODOs left in the code -- [ ] Method [preconditions](https://junit.org/junit5/docs/snapshot/api/org.junit.platform.commons/org/junit/platform/commons/util/Preconditions.html) are checked and documented in the method's Javadoc -- [ ] [Coding conventions](https://github.com/junit-team/junit5/blob/HEAD/CONTRIBUTING.md#coding-conventions) (e.g. for logging) have been followed -- [ ] Change is covered by [automated tests](https://github.com/junit-team/junit5/blob/HEAD/CONTRIBUTING.md#tests) including corner cases, errors, and exception handling -- [ ] Public API has [Javadoc](https://github.com/junit-team/junit5/blob/HEAD/CONTRIBUTING.md#javadoc) and [`@API` annotations](https://apiguardian-team.github.io/apiguardian/docs/current/api/org/apiguardian/api/API.html) -- [ ] Change is documented in the [User Guide](https://junit.org/junit5/docs/snapshot/user-guide/) and [Release Notes](https://junit.org/junit5/docs/snapshot/user-guide/#release-notes) +- [ ] Method [preconditions](https://docs.junit.org/snapshot/api/org.junit.platform.commons/org/junit/platform/commons/util/Preconditions.html) are checked and documented in the method's Javadoc +- [ ] [Coding conventions](https://github.com/junit-team/junit-framework/blob/HEAD/CONTRIBUTING.md#coding-conventions) (e.g. for logging) have been followed +- [ ] Change is covered by [automated tests](https://github.com/junit-team/junit-framework/blob/HEAD/CONTRIBUTING.md#tests) including corner cases, errors, and exception handling +- [ ] Public API has [Javadoc](https://github.com/junit-team/junit-framework/blob/HEAD/CONTRIBUTING.md#javadoc) and [`@API` annotations](https://apiguardian-team.github.io/apiguardian/docs/current/api/org/apiguardian/api/API.html) +- [ ] Change is documented in the [User Guide](https://docs.junit.org/snapshot/user-guide/) and [Release Notes](https://docs.junit.org/snapshot/user-guide/#release-notes) diff --git a/.github/actions/main-build/action.yml b/.github/actions/main-build/action.yml index 338667f8d39b..e5d872267fe0 100644 --- a/.github/actions/main-build/action.yml +++ b/.github/actions/main-build/action.yml @@ -4,7 +4,7 @@ inputs: arguments: required: true description: Gradle arguments - default: :platform-tooling-support-tests:test build --no-configuration-cache # Disable configuration cache due to https://github.com/diffplug/spotless/issues/2318 + default: :platform-tooling-support-tests:test build eclipse --no-configuration-cache # Disable configuration cache due to https://github.com/diffplug/spotless/issues/2318 encryptionKey: required: true description: Gradle cache encryption key diff --git a/.github/actions/run-gradle/action.yml b/.github/actions/run-gradle/action.yml index 90bd8082b59c..9e1022b7fb1a 100644 --- a/.github/actions/run-gradle/action.yml +++ b/.github/actions/run-gradle/action.yml @@ -15,9 +15,9 @@ runs: id: setup-gradle-jdk with: distribution: temurin - java-version: 21 + java-version: 24 check-latest: true - - uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0 + - uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2 with: cache-encryption-key: ${{ inputs.encryptionKey }} - shell: bash diff --git a/.github/actions/setup-test-jdk/action.yml b/.github/actions/setup-test-jdk/action.yml index b2d6b1dbc46b..9e650112b77b 100644 --- a/.github/actions/setup-test-jdk/action.yml +++ b/.github/actions/setup-test-jdk/action.yml @@ -15,3 +15,10 @@ runs: check-latest: true - shell: bash run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV + - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4 + with: + distribution: ${{ inputs.distribution }} + java-version: 17 + check-latest: true + - shell: bash + run: echo "JDK17=$JAVA_HOME" >> $GITHUB_ENV diff --git a/.github/renovate.json5 b/.github/renovate.json5 index d256a62d0f55..ea024d3d17e6 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -3,7 +3,6 @@ extends: [ 'github>junit-team/renovate-config', ], - baseBranches: ["main", "/^develop\\/.*/"], packageRules: [ { matchCurrentValue: '/^2\\./', diff --git a/.github/workflows/close-inactive-issues.yml b/.github/workflows/close-inactive-issues.yml index 4453ca192264..2a76f9cd147d 100644 --- a/.github/workflows/close-inactive-issues.yml +++ b/.github/workflows/close-inactive-issues.yml @@ -3,7 +3,7 @@ on: schedule: - cron: "30 1 * * *" workflow_dispatch: -permissions: read-all +permissions: {} jobs: close-issues: runs-on: ubuntu-latest diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql.yml similarity index 55% rename from .github/workflows/codeql-analysis.yml rename to .github/workflows/codeql.yml index 5664eeca4c65..83dfffdbb590 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql.yml @@ -13,38 +13,46 @@ on: schedule: - cron: '0 19 * * 3' -permissions: read-all +permissions: {} env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} jobs: analyze: - name: Analyze + name: Analyze (${{ matrix.language }}) runs-on: ubuntu-latest permissions: security-events: write strategy: fail-fast: false matrix: - language: - - java - - javascript + include: + - language: actions + build-mode: none + - language: java-kotlin + build-mode: manual + - language: javascript + build-mode: none steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/init@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9 with: languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} tools: linked - name: Build + if: matrix.build-mode == 'manual' uses: ./.github/actions/run-gradle with: encryptionKey: ${{ secrets.GRADLE_ENCRYPTION_KEY }} arguments: | --no-build-cache \ -Dscan.tag.CodeQL \ - allMainClasses + classes - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/analyze@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 7c51412feaaf..612596ae12a4 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -11,7 +11,7 @@ on: branches: - '**' -permissions: read-all +permissions: {} env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} @@ -22,22 +22,22 @@ jobs: fail-fast: false matrix: jdk: - - version: 24 - type: ga - version: 25 type: ea + - version: 26 + type: ea name: "OpenJDK ${{ matrix.jdk.version }} (${{ matrix.jdk.release || matrix.jdk.type }})" runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 - name: Set up Test JDK uses: ./.github/actions/setup-test-jdk - name: "Set up JDK ${{ matrix.jdk.version }} (${{ matrix.jdk.release || 'ea' }})" if: matrix.jdk.type == 'ea' - uses: oracle-actions/setup-java@8fb9d7717810ccde9f8d4bef1e6f43d180f506b5 # v1.4.1 + uses: oracle-actions/setup-java@b1546e588c27008e88bfcabda44d11c22316b9b8 # v1.4.2 with: website: jdk.java.net release: ${{ matrix.jdk.release || matrix.jdk.version }} @@ -76,7 +76,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 - name: Set up Test JDK diff --git a/.github/workflows/gradle-dependency-submission.yml b/.github/workflows/gradle-dependency-submission.yml index eda44140d013..db142002afdf 100644 --- a/.github/workflows/gradle-dependency-submission.yml +++ b/.github/workflows/gradle-dependency-submission.yml @@ -5,24 +5,27 @@ on: branches: - main -permissions: read-all +permissions: {} + +env: + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} jobs: dependency-submission: - if: github.repository == 'junit-team/junit5' + if: github.repository == 'junit-team/junit-framework' runs-on: ubuntu-latest permissions: contents: write steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 - name: Setup Java uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: distribution: temurin - java-version: 21 + java-version: 24 check-latest: true - name: Generate and submit dependency graph - uses: gradle/actions/dependency-submission@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0 + uses: gradle/actions/dependency-submission@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2 diff --git a/.github/workflows/label-opened-issues.yml b/.github/workflows/label-opened-issues.yml index f18377bd22a1..10a5dee96dee 100644 --- a/.github/workflows/label-opened-issues.yml +++ b/.github/workflows/label-opened-issues.yml @@ -3,7 +3,7 @@ on: issues: types: - opened -permissions: read-all +permissions: {} jobs: label_issues: runs-on: ubuntu-latest diff --git a/.github/workflows/label-pull-request.yml b/.github/workflows/label-pull-request.yml new file mode 100644 index 000000000000..c675d52bd3e7 --- /dev/null +++ b/.github/workflows/label-pull-request.yml @@ -0,0 +1,52 @@ +name: Copy labels from linked issues to PR +on: + pull_request_target: + types: [opened, reopened, edited, synchronize] +permissions: {} +jobs: + copy_labels: + name: Copy labels + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + const query = ` + query($owner: String!, $repo: String!, $pr: Int!) { + repository(owner: $owner, name: $repo) { + pullRequest(number: $pr) { + closingIssuesReferences(first: 10) { + nodes { + labels(first: 100) { + nodes { + name + } + } + } + } + } + } + } + `; + + const {repository} = await github.graphql(query, { + owner: context.repo.owner, + repo: context.repo.repo, + pr: context.issue.number + }); + + let labels = Array.from(new Set(repository.pullRequest.closingIssuesReferences.nodes + .flatMap((node) => node.labels.nodes.map((label) => label.name)))) + .filter((label) => !label.startsWith("status:")); + + if (labels.length > 0) { + console.log(`Adding labels to PR: ${labels}`); + await github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: labels + }); + } diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aadc10b78069..f9bdef4bdbb3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ on: branches: - '**' -permissions: read-all +permissions: {} env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} @@ -21,16 +21,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 - name: Install GraalVM - uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # v1.3.3 + uses: graalvm/setup-graalvm@7f488cf82a3629ee755e4e97342c01d6bed318fa # v1.3.5 with: distribution: graalvm-community version: 'latest' java-version: '21' - github-token: ${{ secrets.GITHUB_TOKEN }} - name: Build uses: ./.github/actions/main-build with: @@ -49,7 +48,7 @@ jobs: runs-on: windows-latest steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 - name: Build @@ -61,7 +60,7 @@ jobs: runs-on: macos-latest steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 - name: Build @@ -76,10 +75,10 @@ jobs: permissions: attestations: write # required for build provenance attestation id-token: write # required for build provenance attestation - if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main') + if: github.event_name == 'push' && github.repository == 'junit-team/junit-framework' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main') steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 - name: Publish @@ -93,7 +92,7 @@ jobs: publish -x check \ prepareGitHubAttestation - name: Generate build provenance attestations - uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0 + uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0 with: subject-path: documentation/build/attestation/*.jar @@ -106,7 +105,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 - name: Install Graphviz @@ -126,7 +125,7 @@ jobs: git config --global user.name "JUnit Team" git config --global user.email "team@junit.org" - name: Upload Documentation - if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && github.ref == 'refs/heads/main' + if: github.event_name == 'push' && github.repository == 'junit-team/junit-framework' && github.ref == 'refs/heads/main' uses: ./.github/actions/run-gradle with: encryptionKey: ${{ secrets.GRADLE_ENCRYPTION_KEY }} @@ -135,4 +134,4 @@ jobs: -Dscan.tag.Documentation env: GIT_USERNAME: git - GIT_PASSWORD: ${{ secrets.GH_TOKEN }} + GIT_PASSWORD: ${{ secrets.JUNIT_BUILDS_GITHUB_TOKEN_DOCS_REPO }} diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml index c24ae2e85e54..6bcb06d791f0 100644 --- a/.github/workflows/ossf-scorecard.yml +++ b/.github/workflows/ossf-scorecard.yml @@ -7,7 +7,7 @@ on: push: branches: [ "main" ] -permissions: read-all +permissions: {} jobs: analysis: @@ -21,12 +21,12 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 + uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2 with: results_file: results.sarif results_format: sarif @@ -57,6 +57,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard (optional). # Commenting out will disable upload of results to your repo's Code Scanning dashboard - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/upload-sarif@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9 with: sarif_file: results.sarif diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 09ed237ade58..82ed53a2f8d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ on: required: false default: false -permissions: read-all +permissions: {} env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} @@ -32,7 +32,7 @@ jobs: id-token: write # required for build provenance attestation steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 ref: "refs/tags/${{ env.RELEASE_TAG }}" @@ -63,7 +63,7 @@ jobs: --remote-repo-url=${{ env.STAGING_REPO_URL }} - name: Generate build provenance attestations if: ${{ inputs.dryRun == false }} - uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0 + uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0 with: subject-path: build/repo/**/*.jar @@ -72,40 +72,41 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 ref: "refs/tags/${{ env.RELEASE_TAG }}" - path: junit5 - - name: Check out samples repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + path: junit-framework + - name: Check out examples repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: - repository: ${{ github.repository_owner }}/junit5-samples - token: ${{ secrets.GH_TOKEN }} + repository: ${{ github.repository_owner }}/junit-examples + token: ${{ secrets.JUNIT_BUILDS_GITHUB_TOKEN_EXAMPLES_REPO }} fetch-depth: 1 - path: junit5-samples + path: junit-examples + ref: develop/6.x - name: Set up JDK uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: - java-version: 21 + java-version: 24 distribution: temurin - - uses: sbt/setup-sbt@26ab4b0fa1c47fa62fc1f6e51823a658fb6c760c # v1.1.7 - - name: Update JUnit dependencies in samples + - uses: sbt/setup-sbt@f20dc1bc1f8be605c44ffbcec6f17f708a4af9d1 # v1.1.12 + - name: Update JUnit dependencies in examples run: java src/Updater.java ${{ inputs.releaseVersion }} - working-directory: junit5-samples + working-directory: junit-examples - name: Prepare Maven Central user token - uses: ./junit5/.github/actions/maven-central-user-token + uses: ./junit-framework/.github/actions/maven-central-user-token with: username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - name: Inject staging repository URL run: java src/StagingRepoInjector.java ${{ env.STAGING_REPO_URL }} - working-directory: junit5-samples - - name: Build samples - run: java src/Builder.java --exclude=junit5-jupiter-starter-bazel,junit5-jupiter-starter-sbt - working-directory: junit5-samples + working-directory: junit-examples + - name: Build examples + run: java src/Builder.java --exclude=junit-jupiter-starter-bazel,junit-jupiter-starter-sbt + working-directory: junit-examples env: - MAVEN_ARGS: --settings ${{ github.workspace }}/junit5-samples/src/central-staging-maven-settings.xml --activate-profiles central-staging + MAVEN_ARGS: --settings ${{ github.workspace }}/junit-examples/src/central-staging-maven-settings.xml --activate-profiles central-staging close_github_milestone: name: Close GitHub milestone @@ -119,17 +120,30 @@ jobs: with: result-encoding: string script: | - const milestones = await github.rest.issues.listMilestones({ + const query = ` + query ($owner: String!, $repo: String!, $title: String!) { + repository(owner: $owner, name: $repo) { + milestones(first: 100, query: $title) { + nodes { + title + number + openIssueCount + } + } + } + } + `; + const {repository} = await github.graphql(query, { owner: context.repo.owner, repo: context.repo.repo, - state: 'all' + title: "${{ inputs.releaseVersion }}" }); - const [milestone] = milestones.data.filter(x => x.title === "${{ inputs.releaseVersion }}") + const [milestone] = repository.milestones.nodes.filter(it => it.title === "${{ inputs.releaseVersion }}") if (!milestone) { throw new Error('Milestone "${{ inputs.releaseVersion }}" not found'); } - if (milestone.open_issues > 0) { - throw new Error(`Milestone "${{ inputs.releaseVersion }}" has ${milestone.open_issues} open issue(s)`); + if (milestone.openIssueCount > 0) { + throw new Error(`Milestone "${{ inputs.releaseVersion }}" has ${milestone.openIssueCount} open issue(s)`); } const requestBody = { owner: context.repo.owner, @@ -147,7 +161,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 ref: "refs/tags/${{ env.RELEASE_TAG }}" @@ -169,7 +183,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 ref: "refs/tags/${{ env.RELEASE_TAG }}" @@ -196,7 +210,7 @@ jobs: uses: ./.github/actions/run-gradle env: GIT_USERNAME: git - GIT_PASSWORD: ${{ secrets.GH_TOKEN }} + GIT_PASSWORD: ${{ secrets.JUNIT_BUILDS_GITHUB_TOKEN_DOCS_REPO }} with: encryptionKey: ${{ secrets.GRADLE_ENCRYPTION_KEY }} arguments: | @@ -209,7 +223,7 @@ jobs: id: pagesDeployment timeout-minutes: 20 run: | - URL="https://junit.org/junit5/docs/${{ inputs.releaseVersion }}/user-guide/junit-user-guide-${{ inputs.releaseVersion }}.pdf" + URL="https://docs.junit.org/${{ inputs.releaseVersion }}/user-guide/junit-user-guide-${{ inputs.releaseVersion }}.pdf" ./.github/scripts/waitForUrl.sh "$URL" echo "pdfUrl=$URL" >> "$GITHUB_OUTPUT" - name: Verify integrity of PDF version of User Guide @@ -218,26 +232,27 @@ jobs: curl --silent --fail --location --output /tmp/junit-user-guide.pdf "${{ steps.pagesDeployment.outputs.pdfUrl }}" pdfinfo /tmp/junit-user-guide.pdf - update_samples: - name: Update samples + update_examples: + name: Update examples needs: publish_deployment runs-on: ubuntu-latest steps: - - name: Check out samples repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Check out examples repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: - repository: ${{ github.repository_owner }}/junit5-samples - token: ${{ secrets.GH_TOKEN }} + repository: ${{ github.repository_owner }}/junit-examples + token: ${{ secrets.JUNIT_BUILDS_GITHUB_TOKEN_EXAMPLES_REPO }} fetch-depth: 1 + ref: develop/6.x - name: Set up JDK uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: - java-version: 21 + java-version: 24 distribution: temurin - - uses: sbt/setup-sbt@26ab4b0fa1c47fa62fc1f6e51823a658fb6c760c # v1.1.7 - - name: Update JUnit dependencies in samples + - uses: sbt/setup-sbt@f20dc1bc1f8be605c44ffbcec6f17f708a4af9d1 # v1.1.12 + - name: Update JUnit dependencies in examples run: java src/Updater.java ${{ inputs.releaseVersion }} - - name: Build samples + - name: Build examples if: ${{ inputs.dryRun == false }} run: java src/Builder.java - name: Create release branch @@ -261,7 +276,7 @@ jobs: create_github_release: name: Create GitHub release if: ${{ inputs.dryRun == false }} - needs: [ publish_documentation, update_samples ] + needs: [ publish_documentation, update_examples ] runs-on: ubuntu-latest permissions: contents: write @@ -271,16 +286,13 @@ jobs: with: script: | const releaseVersion = "${{ inputs.releaseVersion }}"; - const jupiterVersion = releaseVersion; - const vintageVersion = releaseVersion; - const platformVersion = "1." + releaseVersion.substring(2); const requestBody = { owner: context.repo.owner, repo: context.repo.repo, tag_name: `r${releaseVersion}`, name: `JUnit ${releaseVersion}`, generate_release_notes: true, - body: `JUnit ${jupiterVersion} = Platform ${platformVersion} + Jupiter ${jupiterVersion} + Vintage ${vintageVersion}\n\nSee [Release Notes](https://junit.org/junit5/docs/${releaseVersion}/release-notes/).`, + body: `JUnit ${releaseVersion} = Platform ${releaseVersion} + Jupiter ${releaseVersion} + Vintage ${releaseVersion}\n\nSee [Release Notes](https://docs.junit.org/${releaseVersion}/release-notes/).`, prerelease: releaseVersion.includes("-"), }; console.log(requestBody); diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index 546ff5b9cd18..9fb6967d73eb 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -9,7 +9,7 @@ on: branches: - '**' -permissions: read-all +permissions: {} env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 1 - name: Restore Gradle cache and display toolchains diff --git a/.github/workflows/sanitize-closed-issues.yml b/.github/workflows/sanitize-closed-issues.yml index 046be82f7804..ca77b2bd4f9d 100644 --- a/.github/workflows/sanitize-closed-issues.yml +++ b/.github/workflows/sanitize-closed-issues.yml @@ -3,7 +3,7 @@ on: issues: types: - closed -permissions: read-all +permissions: {} jobs: label_issues: runs-on: ubuntu-latest diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 9f10a217b5b9..da9a350c8e4c 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -7,6 +7,7 @@