diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 000000000000..2af832940ac6 --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,8 @@ +# DO NOT COMMIT WORKFLOWS ON THIS BRANCH + +Nearly all contributions in this repostory come as pull requests from forks. +For such pull requests, Github uses workflow definitions from the repository's main branch (i.e. `main`). + +If you want to change an existing workflow or ad a new one, please submit a PR to the `main` branch; +making any changes on this branch will have no effect in practice. + diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml deleted file mode 100644 index 44f32ca37d7c..000000000000 --- a/.github/workflows/auto-approve.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Auto approve patch updates - -on: - pull_request_target: - types: [labeled] - -jobs: - auto-approve: - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - uses: hmarr/auto-approve-action@v4 - if: contains(github.event.pull_request.labels.*.name, 'semver-spec-patch') && github.actor == 'scalameta-bot' - with: - github-token: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 66a17b8e3898..000000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,180 +0,0 @@ -name: CI -on: - push: - branches: - - main-v2 - pull_request: - branches: - - main-v2 - -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -jobs: - unit: - name: ${{ matrix.os }} jdk-${{ matrix.java }} unit tests ${{ matrix.shard }} / ${{ matrix.shardCount }} - runs-on: - labels: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/main-v2') && fromJson('["ubuntu-latest", "windows-latest"]') || fromJson('["ubuntu-latest"]') }} - java: ["17"] - shard: [1, 2, 3, 4, 5, 6, 7, 8] - shardCount: [8] - timeout-minutes: 30 - steps: - - uses: actions/checkout@v6 - - uses: coursier/setup-action@v3 - - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - java-version: ${{ matrix.java }} - - uses: coursier/cache-action@v8 - with: - ignoreJob: true - ignoreMatrix: true - - uses: sbt/setup-sbt@v1 - - name: Configure git - run: | - # This is required for some tests that create a git repo - git config --global user.email "ci@scalameta.org" - git config --global user.name "CI Bot" - - name: Run unit tests - run: | - bin/test.sh unit/test - env: - JAVA_VERSION: ${{ matrix.java }} - TEST_SHARD: ${{ matrix.shard }} - TEST_SHARD_COUNT: ${{ matrix.shardCount }} - GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} - GOOGLE_APPLICATION_CREDENTIALS_JSON: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }} - shell: bash - - name: Upload heap dump if exists - uses: actions/upload-artifact@v7 - if: always() # This ensures the step runs even if previous steps fail - with: - name: heap-dumps-${{ matrix.os }}-${{ matrix.shard }}-${{ github.run_id }} - path: | - ./**/*.hprof - retention-days: 5 - - name: Upload test reports - if: always() - uses: actions/upload-artifact@v7 - with: - name: unit-test-reports-${{ matrix.os }}-${{ matrix.shard }}-${{ github.run_id }} - path: "**/target/test-reports/*.xml" - if-no-files-found: ignore - retention-days: 7 - compression-level: 9 - integration: - name: ${{ matrix.name }} - runs-on: - labels: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - type: - [ -# sbt, - # bazel, -# feature, - cross, - scalafmt, - scalafix, - ] - include: -# - type: sbt -# command: | -# bin/test.sh +sbt-metals/publishLocal -# bin/test.sh 'slow/testOnly -- tests.sbt.*' -# name: Sbt integration -# os: ubuntu-latest -# java: "17" - - type: bazel - command: | - bin/test.sh quick-publish-local - bin/test.sh 'slow/testOnly -- tests.bazel.*' - name: Bazel integration - os: ubuntu-latest - java: "17" - - type: gradle - command: | - bin/test.sh quick-publish-local - bin/test.sh 'slow/testOnly -- tests.gradle.*' - name: Gradle integration - os: ubuntu-latest - java: "17" -# - type: feature -# command: bin/test.sh 'slow/testOnly -- tests.feature.*' -# name: LSP integration tests -# os: ubuntu-latest -# java: "17" - - type: cross - command: sbt +cross/test - name: Scala cross tests - os: ubuntu-latest - java: "17" - - type: mtags-java - command: sbt javapc/test - name: Scala javapc tests - os: ubuntu-latest - java: "17" - - type: maven-metals - command: | - sbt maven-metals/test - bin/test.sh quick-publish-local - bin/test.sh 'slow/testOnly -- tests.maven.MavenMbtSuite' - name: Maven integration - os: ubuntu-latest - java: "17" - - type: scalafix - command: sbt scalafixCheck docs/docusaurusCreateSite - name: Scalafix and docs - os: ubuntu-latest - java: "17" - - type: scalafmt - command: | - ./bin/scalafmt --test - sbt javafmtCheckAll - name: Formatting - os: ubuntu-latest - java: "17" - - type: MiMa - command: sbt interfaces/mimaReportBinaryIssues - name: MiMa - os: ubuntu-latest - java: "17" - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - java-version: ${{ matrix.java }} - - uses: coursier/cache-action@v8 - with: - ignoreJob: true - ignoreMatrix: true - - uses: sbt/setup-sbt@v1 - with: - sbt-runner-version: 1.10.3 - - name: ${{ matrix.command }} - run: | - ${{ matrix.command }} - env: - METALS_TEST: true - GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} - GOOGLE_APPLICATION_CREDENTIALS_JSON: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }} - - name: Upload test reports - if: always() - uses: actions/upload-artifact@v7 - with: - name: integration-test-reports-${{ matrix.type }}-${{ github.run_id }} - path: "**/target/test-reports/*.xml" - if-no-files-found: ignore - retention-days: 7 - compression-level: 9 - - name: "test download dependencies" - run: sbt downloadDependencies - if: matrix.type == 'cross' diff --git a/.github/workflows/close-inactive-needs-more-info-issues.yml b/.github/workflows/close-inactive-needs-more-info-issues.yml deleted file mode 100644 index 852e133e88e7..000000000000 --- a/.github/workflows/close-inactive-needs-more-info-issues.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Close inactive issues that need more information -on: - schedule: - - cron: "15 10 * * 1-5" - -jobs: - close-issues: - runs-on: ubuntu-latest - permissions: - issues: write - steps: - - uses: actions/stale@v10 - with: - days-before-issue-close: 30 - stale-issue-label: "needs more information" - close-issue-message: "This issue was closed because no new information was added for the last 30 days. If you have any relevant information, feel free to add it and reopen the issue." - remove-stale-when-updated: false - days-before-issue-stale: -1 - days-before-pr-stale: -1 - days-before-pr-close: -1 - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/mtags-release.yml b/.github/workflows/mtags-release.yml deleted file mode 100644 index 6185d85474ae..000000000000 --- a/.github/workflows/mtags-release.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Release mtags and mtagsShared for version - -on: - workflow_dispatch: - inputs: - version: - description: "Metals version (e.g., 1.2.3)" - required: true - branch: - description: "Branch or tag to release from (e.g., v1.6.3)" - required: true - scala: - description: "Scala version (e.g., 2.13.17)" - required: false - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - name: Check out tag v${{ github.event.inputs.version }} - uses: actions/checkout@v6 - with: - fetch-depth: 0 - ref: ${{ github.event.inputs.branch }} - - uses: olafurpg/setup-scala@v14 - - name: Set up JVM - uses: actions/setup-java@v5 - with: - java-version: '17' - distribution: 'temurin' - cache: 'sbt' - - uses: sbt/setup-sbt@v1 - - name: Publish ${{ github.event.inputs.project }} to Sonatype - run: sbt "set ThisBuild/version := \"${{ github.event.inputs.version }}\" ; set ThisBuild/isSnapshot := false; ++${{github.event.inputs.scala}}!; ci-release" - env: - CI_COMMIT_TAG: v${{ github.event.inputs.version }} - CI_RELEASE: mtags/publishSigned; mtagsShared/publishSigned - SCALAMETA_PLATFORM: ${{ github.event.inputs.platform }} - GIT_USER: scalameta@scalameta.org - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - PGP_SECRET: ${{ secrets.PGP_SECRET }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }} - GOOGLE_APPLICATION_CREDENTIALS: - ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} - GOOGLE_APPLICATION_CREDENTIALS_JSON: - ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index fe5291b2667b..000000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Release -on: - push: - branches: [main-v2] - tags: ["**"] -# concurrency: -# group: release-${{ github.ref }} -jobs: - publish: - runs-on: warp-ubuntu-latest-x64-4x - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - # Do not change the version of Java, it is the minimal version Metals works with - java-version: 17 - cache: 'sbt' - - uses: sbt/setup-sbt@v1 - - name: Publish to Sonatype - run: sbt ci-release - env: - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - PGP_SECRET: ${{ secrets.PGP_SECRET }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - # - name: Publish Documentation - # if: ${{ !contains(github.ref_name, '@') }} - # run: sbt docs/docusaurusPublishGhpages - # env: - # GIT_USER: scalameta@scalameta.org - # GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }} diff --git a/.github/workflows/sbt-dependency-graph.yml b/.github/workflows/sbt-dependency-graph.yml deleted file mode 100644 index 95974a671b17..000000000000 --- a/.github/workflows/sbt-dependency-graph.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Sbt Dependency Graph -on: - push: - branches: - - main -jobs: - update-graph: - name: Update graph - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: sbt/setup-sbt@v1 - - uses: scalacenter/sbt-dependency-submission@v3 diff --git a/.github/workflows/test-failures-report.yml b/.github/workflows/test-failures-report.yml deleted file mode 100644 index b7825b4ce6f6..000000000000 --- a/.github/workflows/test-failures-report.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: 'Test Failures Report' -on: - workflow_run: - workflows: ['CI'] - types: - - completed -permissions: - statuses: write - checks: write - contents: write - pull-requests: write - actions: write -jobs: - aggregate-test-reports: - if: always() - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Download reports for each test job - uses: dawidd6/action-download-artifact@v21 - with: - workflow: ci.yml - workflow_conclusion: completed - merge_multiple: 'true' - - name: Test Report - uses: dorny/test-reporter@29672c52a8220c09bd9f79b5b6cf6315f1763996 - with: - name: Aggregated failure reports - path: "**/target/test-reports/*.xml" - reporter: java-junit - list-suites: failed - list-tests: failed - list-files: failed - use-actions-summary: 'true' \ No newline at end of file